Adding retry when we received 200

If we received 200, we will attempt to download the stream. If the
stream is gzipped, gzip should throw an error when trying to decompress
the stream; or if the stream is truncated, the received bytes should be
different from the value set in content-length header.
This commit is contained in:
Yang Cao
2020-12-03 10:13:36 -05:00
parent 990647a104
commit 6b83f0554a
3 changed files with 79 additions and 15 deletions

View File

@@ -303,6 +303,15 @@ export async function createEmptyFilesForArtifact(
}
}
export async function getFileSize(filePath: string): Promise<number> {
const stats = await fs.stat(filePath)
return stats.size
}
export async function rmFile(filePath: string): Promise<void> {
await fs.unlink(filePath)
}
export function getProperRetention(
retentionInput: number,
retentionSetting: string | undefined