alisaifee / limits

Rate limiting using various strategies and storage backends such as redis & memcached
https://limits.readthedocs.org
MIT License
423 stars 59 forks source link

Correct the value of `reset_time` for MovingWindow strategy #202

Closed alisaifee closed 8 months ago

alisaifee commented 8 months ago

Description

The value of reset_time for the moving window strategy is currently derived from the newest entry in the moving window instead of the oldest.

Related issues

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f1fe9f3) 96.83% compared to head (5929f71) 96.99%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #202 +/- ## ========================================== + Coverage 96.83% 96.99% +0.15% ========================================== Files 25 25 Lines 1265 1265 Branches 135 135 ========================================== + Hits 1225 1227 +2 Misses 20 20 + Partials 20 18 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alisaifee commented 8 months ago

@skalpel: if you could try this branch out with any other usecases you have I'd appreciate that!

skalpel commented 8 months ago

For my use case (sync rate limiting with in-memory storage) it works excellent!

skalpel commented 8 months ago

@alisaifee just out of curiosity, when is it going to be released?

alisaifee commented 8 months ago

@alisaifee just out of curiosity, when is it going to be released?

Sorry about the delay - now available in 3.10.0

skalpel commented 8 months ago

Thanks a lot!