wemake-services / asyncio-redis-rate-limit

Rate limiter for async functions using Redis as a backend.
https://pypi.org/project/asyncio-redis-rate-limit/
MIT License
34 stars 3 forks source link

add use nx option #215

Open GrozniyToaster opened 1 week ago

GrozniyToaster commented 3 days ago

Is that correct?

What NX means?

NX -- Set expiry only when the key has no expiry

So, basically it is only set once, with the very first request. Without NX it will reset EXPIRE on every _run_pipeline call.

Yes, can’t do it without nx

I redesigned the pipeline just to put TTL on the first request