Skip to content

#113 fix queue delay with exec evenly flag#359

Merged
animir merged 2 commits into
masterfrom
113-fix-queue-with-exec-evenly
Apr 18, 2026
Merged

#113 fix queue delay with exec evenly flag#359
animir merged 2 commits into
masterfrom
113-fix-queue-with-exec-evenly

Conversation

@animir

@animir animir commented Apr 18, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an execEvenly interaction where the resolved RateLimiterRes.msBeforeNext could be “stale” (still including the time already waited due to execEvenly delay), which could cause downstream logic like RateLimiterQueue to over-wait.

Changes:

  • Adjust RateLimiterRes.msBeforeNext by subtracting the applied execEvenly delay before resolving.
  • Add coverage to ensure msBeforeNext is updated after execEvenly-based waiting.
  • Add a queue-level regression test to ensure no extra wait occurs when the underlying limiter uses execEvenly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/RateLimiterQueue.test.js Adds regression test for queue timing when underlying limiter uses execEvenly.
test/RateLimiterMemory.test.js Adds test asserting msBeforeNext is reduced after an execEvenly delay.
lib/RateLimiterStoreAbstract.js Updates exec-evenly resolve path to reduce msBeforeNext by the actual delay waited.
lib/RateLimiterMemory.js Mirrors the same msBeforeNext adjustment for the in-memory limiter’s exec-evenly path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@animir
animir merged commit 3b6b656 into master Apr 18, 2026
10 checks passed
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.

2 participants