Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various rate limiting issues #1424

Merged
merged 10 commits into from
Jul 31, 2020
Next Next commit
retry after abuse limit
  • Loading branch information
hipstersmoothie committed Jul 30, 2020
commit 80b3922391a31f56e4570165e65cdfa3602cfb8b
7 changes: 4 additions & 3 deletions packages/core/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,12 @@ export default class Git {
return true;
}
},
/** does not retry, only logs an error */
onAbuseLimit: (_: number, opts: ThrottleOpts) => {
/** wait after abuse */
onAbuseLimit: (retryAfter: number, opts: ThrottleOpts) => {
this.logger.log.error(
`Went over abuse rate limit ${opts.method} ${opts.url}`
`Went over abuse rate limit ${opts.method} ${opts.url}, retrying in ${retryAfter} seconds.`
);
return true;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will now actually retry after abuse limit is hit

},
},
});
Expand Down