You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enable allowN and allowAtMost to peek at contents (#47)
* add failing test for allowN increment of zero
* fix lua script to allow increment by zero (effectively peek)
In past versions of redis_rate, you could peek at the current state
in the redis limiter by calling allowN but not incrementing. The
move to lua script did not preserve this (unadvertised) ability.
This adds it back, the only issue was trying to SET a redis
row with an expiry of zero if the row didn't exist. Since the
caller doesn't want to increment at all, this changes the SET
to not be called if the value is absent.
* same test and fix for allowAtMost increment by zero
* add test for peeking after a write
0 commit comments