Merge pull request #2124 from akashchi/reject-on-download-failure
[ARTIFACT] Reject download promise if timeout was reached
This commit is contained in:
@@ -79,9 +79,11 @@ export async function streamExtractExternal(
|
|||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const timerFn = (): void => {
|
const timerFn = (): void => {
|
||||||
response.message.destroy(
|
const timeoutError = new Error(
|
||||||
new Error(`Blob storage chunk did not respond in ${timeout}ms`)
|
`Blob storage chunk did not respond in ${timeout}ms`
|
||||||
)
|
)
|
||||||
|
response.message.destroy(timeoutError)
|
||||||
|
reject(timeoutError)
|
||||||
}
|
}
|
||||||
const timer = setTimeout(timerFn, timeout)
|
const timer = setTimeout(timerFn, timeout)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user