retry on HTTP status 429 "Too Many Requests"

This commit is contained in:
tophf 2018-07-02 17:20:22 +03:00
parent 5e34c9705c
commit d37b113d0d

View File

@ -105,8 +105,10 @@ global API_METHODS
}
function reportFailure(error) {
// retry once if the error is 503 Service Unavailable
if (error === 503 && !retrying.has(id)) {
if ((
error === 503 || // Service Unavailable
error === 429 // Too Many Requests
) && !retrying.has(id)) {
retrying.add(id);
return new Promise(resolve => {
setTimeout(() => {