-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
bot, rules: fix rate limiting rules without a rate limit #2629
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than a minor style nit, I have nothing to say, really.
Not the end of the world if you don't get around to git commit --amend && git push -f
before I come back to merge this (next week? probably) but that one tiny section of code I commented on would be slightly more readable. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I suggested as much as I could relating to the unnecessary *_metrics
assignments. GitHub won't let me add a line note to the metrics = global_metrics
line, so sorry, you're on your own.
This will not fix errors in mypy 1.12, though. What this code does with channel
is incompatible with the AbstractRule
interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, it looks so much cleaner now without the extra *_metrics
locals. 😁
Good to squash
Co-authored-by: dgw <dgw@technobabbl.es>
440ec4b
to
94e2c92
Compare
Done. |
Description
Fix #2627 by checking if the rate limit is actually set (equal or less than 0s).
I decided to make the
at_time
parameter mandatory, as it's all internal stuffs and it makes it clearer what time we are comparing it to. That's how I figured out that it was about the repeating call to the same rule for a single trigger: it would check against the same trigger object, but compare it to the latest call tonow()
. That's why the bug was visible onurl
rules, and it affectedfind
rules as well.Checklist
make qa
(runsmake lint
andmake test
)