Retry artifact download when response stream is truncated

This commit is contained in:
Chris Sidi authored and Yang Cao committed 2020-12-03 10:12:44 -05:00
1 parent 0a0169da7d
commit d26929d028
2 files changed
+71 -6

No files matched your search

+6
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()