From d37b113d0d603ac93accf7ece18a2548dd77c7b4 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 2 Jul 2018 17:20:22 +0300 Subject: [PATCH] retry on HTTP status 429 "Too Many Requests" --- background/update.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/background/update.js b/background/update.js index 1a005152..3f35283d 100644 --- a/background/update.js +++ b/background/update.js @@ -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(() => {