fix(api): bitbucket implicit auth login delay (#4243)

This commit is contained in:
Eugene Michasiw 2020-09-01 08:36:26 -04:00 committed by GitHub
parent 7affaf54c5
commit a80ab123dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,9 @@ export const requestWithBackoff = async (
}
return response;
} catch (err) {
if (attempt <= 5) {
if (attempt > 5 || err.message === "Can't refresh access token when using implicit auth") {
throw err;
} else {
if (!api.rateLimiter) {
const timeout = err.resetSeconds || attempt * attempt;
console.log(
@ -87,8 +89,6 @@ export const requestWithBackoff = async (
}, 1000 * timeout);
}
return requestWithBackoff(api, req, attempt + 1);
} else {
throw err;
}
}
};