Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit f659e78

Browse files
committed
Retry on request timeout
1 parent bc1578c commit f659e78

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/deploy/upload-files.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,14 @@ function retryUpload(uploadFn, maxRetry) {
9292
.then(results => resolve(results))
9393
.catch(e => {
9494
lastError = e
95-
if (e.name === 'FetchError') {
96-
console.log(e)
97-
fibonacciBackoff.backoff()
98-
} else {
99-
return reject(e)
95+
switch (true) {
96+
case e.status === 408: // request timeout
97+
case e.name === 'FetchError': {
98+
return fibonacciBackoff.backoff()
99+
}
100+
default: {
101+
return reject(e)
102+
}
100103
}
101104
})
102105
}

0 commit comments

Comments
 (0)