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

Commit

Permalink
Retry on request timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Nov 6, 2018
1 parent bc1578c commit f659e78
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/deploy/upload-files.js
Expand Up @@ -92,11 +92,14 @@ function retryUpload(uploadFn, maxRetry) {
.then(results => resolve(results))
.catch(e => {
lastError = e
if (e.name === 'FetchError') {
console.log(e)
fibonacciBackoff.backoff()
} else {
return reject(e)
switch (true) {
case e.status === 408: // request timeout
case e.name === 'FetchError': {
return fibonacciBackoff.backoff()
}
default: {
return reject(e)
}
}
})
}
Expand Down

0 comments on commit f659e78

Please sign in to comment.