How to set one hour limit for sliding window?
samuelpalaciosdev opened this issue · 2 comments
samuelpalaciosdev commented
Hey, I've been trying to setup my rate limiter like this:
const ratelimit = new Ratelimit({ redis: Redis.fromEnv(), limiter: Ratelimit.slidingWindow(2, '3600 s'), });
But it doesn't seem to work, there's a special way to reference an hour or theres a time limit?
fahreddinozcan commented
Hey, can you try slidingWindow(2, "1 h")
? The possible units are ms | s | m | h | d |
samuelpalaciosdev commented
Thanks! didn't know that. It could be a good add to the documentation.