Skip to content

Conversation

@abhijeet4725
Copy link
Contributor

Description:

  • Updated replenishRate in RedisRateLimiter and its inner Config class to double to allow fractional refill rates.
  • Updated validation from @Min(1) to @DecimalMin(value="0.0", inclusive=false) to allow values > 0.
  • Constructor and internal usage updated to preserve fractional values (no truncation).
  • Added a focused test in RedisRateLimiterConfigTests to validate fractional refill behavior.
  • Local test note: Integration test relies on Testcontainers (Docker). Local test skipped due to Docker environment not detected. CI will execute the full test suite.

Motivation / Issue Reference:
Fixes #2145

Testing done:

  • Module compiles successfully.
  • Verified fractional-rate logic manually in code.
  • CI will validate test correctness.

Impact:

  • Minimal and safe change.
  • Backward-compatible for integer replenishRate.
  • No changes to Lua script or burst capacity logic.

Signed-off-by: abhijeet4725 <abhijeetcs4725@gmail.com>
Copy link
Member

@spencergibb spencergibb left a comment

Choose a reason for hiding this comment

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

The build failed in redis rate limiter tests, so this has broken something

Signed-off-by: abhijeet4725 <abhijeetcs4725@gmail.com>
Signed-off-by: abhijeet4725 <abhijeetcs4725@gmail.com>
@abhijeet4725
Copy link
Contributor Author

Thanks for the review! I’ve applied the requested change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow making replenishRate float?

3 participants