forked from mirrored/github-readme-stats
Compare commits
1
Commits
main
...
anu/fix-retryer
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58d2ae6ebf |
@@ -45,8 +45,9 @@ const retryer = async (fetcher, variables, retries = 0) => {
|
|||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
// also checking for bad credentials if any tokens gets invalidated
|
// also checking for bad credentials if any tokens gets invalidated
|
||||||
const isBadCredential = err.response.data && err.response.data.message === "Bad credentials";
|
const isBadCredential = err.response.data && err.response.data.message === "Bad credentials";
|
||||||
|
const isAccountSuspended = err.response.data && err.response.data.message === "Sorry. Your account was suspended.";
|
||||||
|
|
||||||
if (isBadCredential) {
|
if (isBadCredential || isAccountSuspended) {
|
||||||
logger.log(`PAT_${retries + 1} Failed`);
|
logger.log(`PAT_${retries + 1} Failed`);
|
||||||
retries++;
|
retries++;
|
||||||
// directly return from the function
|
// directly return from the function
|
||||||
|
|||||||
Reference in New Issue
Block a user