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(rate-limit): check runs, not tests #1625

Merged
merged 1 commit into from
Nov 15, 2021
Merged

Conversation

jefflembeck
Copy link
Contributor

With the current code, somebody could potentially run 900 test runs (well,
more since the cache is in-memory) before they hit the limit. Let's
count every run.

With the current code, somebody could potentially run 900 test runs (well,
more since the cache is in-memory) before they hit the limit. Let's
count every run.
@jefflembeck jefflembeck merged commit 51c298e into master Nov 15, 2021
@jefflembeck jefflembeck deleted the check-runs-not-tests branch November 15, 2021 22:18
Comment on lines +20 to +22
for ($i = 0; $i < $times_to_add; $i++) {
$bucket[] = time();
}
Copy link
Contributor

@rik rik Nov 15, 2021

Choose a reason for hiding this comment

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

Suggested change
for ($i = 0; $i < $times_to_add; $i++) {
$bucket[] = time();
}
array_push($bucket, ...array_fill(0, $times_to_add, time()));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh that's a lot nicer!

jefflembeck added a commit that referenced this pull request Nov 15, 2021
This is a cleaner way of doing the for loop push thing.

See #1625 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants