Retry artifact download when response stream is truncated

This commit is contained in:
Chris Sidi
2020-11-25 23:04:07 -05:00
committed by Yang Cao
parent ff4308098f
commit 520206f818
2 changed files with 71 additions and 6 deletions

View File

@@ -264,6 +264,12 @@ export class DownloadHttpClient {
const gunzip = zlib.createGunzip()
response.message
.pipe(gunzip)
.on('error', error => {
core.error(
`An error has been encountered while attempting to decompress a file`
)
reject(error)
})
.pipe(destinationStream)
.on('close', () => {
resolve()