Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add delay between pull request updates
In projects with many open PRs using the automatic updates feature, Bulldozer can trigger GitHub's secondary rate limits by updating (and possibly querying) pull requests too quickly. To avoid this, add some delay between operations. For queries, use a fixed 250ms delay for now. This shouldn't slow things down too much, but does prevent Bulldozer from blasting through PRs as fast as possible. For updates, use an exponential delay that starts at 1s and maxes out at 60s. I believe the secondary limits (at least for GitHub Enterprise) are computed over a minute, so this will limit us to one update per minute for large batches. I don't think this will be prohibitively slow, but we could explore making this configurable in the future. As part of this, refactor the logic so that we don't block queries on previous updates.
- Loading branch information