upstash / ratelimit-js

Rate limiting library for serverless runtimes
https://ratelimit-with-vercel-kv.vercel.app
MIT License
1.65k stars 33 forks source link

No TTL set for slidingWindow rate limit keys on latest version #95

Closed szwabodev closed 5 months ago

szwabodev commented 5 months ago

Hello,

I noticed that all of the keys stored in redis remain kept forever since I upgraded to latest version of @upstash/ratelimit (1.0.3 to be specific). I use slidingWindow method for rate limiting, and after reverting to version 1.0.1 everything works fine and TTL is set for every key created by Ratelimit. I don't use analytics if this matters (it's set to false).

Hopefully you can take a look and have it fixed, for now I must remain on the older version.

CahidArda commented 5 months ago

Hello there,

I noticed the same issue in regular sliding window and I have a fix in PR #94. I am assuming you are using that one. This PR will fix the issue for regular rate limiting. If you are experiencing this is Multi Region sliding window, let me know!

CahidArda commented 5 months ago

hi @szwabodev,

The PR fixing this issue was merged. We have a new version 1.1.1