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

Update rate limit policy to set redis expiry inline with windowMs #874

Merged

Conversation

ciaranashton
Copy link
Contributor

@ciaranashton ciaranashton commented Mar 6, 2019

Redis rate limiter expires by default at 60 seconds.

Dividing the windowMs into seconds and then passing it through to replace the default expiry: 60 will ensure you get correct rate limiting when storing counters in Redis.

@codecov
Copy link

codecov bot commented Mar 6, 2019

Codecov Report

Merging #874 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #874   +/-   ##
=======================================
  Coverage   89.25%   89.25%           
=======================================
  Files         135      135           
  Lines        3649     3649           
=======================================
  Hits         3257     3257           
  Misses        392      392
Impacted Files Coverage Δ
lib/policies/rate-limit/rate-limit.js 90% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2846971...1f2dac2. Read the comment docs.

@XVincentX
Copy link
Member

Good catch! Thanks a lot for this!

gatherchou pushed a commit to yilu-tech/express-gateway that referenced this pull request Jul 29, 2021
…ire-on-windowms

Update rate limit policy to set redis expiry inline with windowMs
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.

None yet

2 participants