Skip to content

Commit 83b19f6

Browse files
committed
rename
1 parent a41f4c4 commit 83b19f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fetch-with-retry.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ export function httpPost(route, json) {
1515

1616

1717
function fetchWithRetry(url, options) {
18-
const AttemptAt = [0, 1500, 3000, 5000] // milliseconds
18+
const AttemptDelay = [0, 1500, 3000, 5000] // milliseconds
1919
const isError = status => status >= 500 && status < 600
2020
return new Promise((resolve, reject) => {
2121
(function attemptFetch() {
2222
setTimeout(() => {
2323
fetch(url, options).then(response => {
24-
if (isError(response.status) && AttemptAt.length)
24+
if (isError(response.status) && AttemptDelay.length)
2525
attemptFetch()
2626
else
2727
resolve(response)
2828
}).catch(error => {
29-
if (AttemptAt.length)
29+
if (AttemptDelay.length)
3030
attemptFetch()
3131
else
3232
reject(error)
3333
})
34-
}, AttemptAt.shift())
34+
}, AttemptDelay.shift())
3535
}())
3636
})
3737
}

0 commit comments

Comments
 (0)