Tags: go-redis/redis_rate
Tags
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
PreviousNext