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 #5122 Rate limit remaining requests log to debug #5402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/rate-limiter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class KumaRateLimiter {
*/
async pass(callback, num = 1) {
const remainingRequests = await this.removeTokens(num);
log.info("rate-limit", "remaining requests: " + remainingRequests);
log.debug("rate-limit", "remaining requests: " + remainingRequests);
Copy link
Collaborator

@CommanderStorm CommanderStorm Dec 3, 2024

Choose a reason for hiding this comment

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

Sorry, but this does not fix the underlying issue as far as I see it.

This being an Info level log is reasonable and should not be changed.
What I see as the problem instead is that this log message should only fire if remainingRequests is significantly below tokensPerInterval

Copy link
Author

Choose a reason for hiding this comment

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

Ok soryy,
then I misunderstood this comment: #5122 (comment)

if (remainingRequests < 0) {
if (callback) {
callback({
Expand Down
Loading