FIX: Ignore Redis readonly errors in `RateLimiter#rollback!`.
This is similar to what we're doing in `RateLimiter#performed!`.
This commit is contained in:
parent
a26b490047
commit
2e8075bac3
|
@ -102,6 +102,12 @@ class RateLimiter
|
|||
def rollback!
|
||||
return if RateLimiter.disabled?
|
||||
redis.lpop(prefixed_key)
|
||||
rescue Redis::CommandError => e
|
||||
if e.message =~ /READONLY/
|
||||
# TODO,switch to in-memory rate limiter
|
||||
else
|
||||
raise
|
||||
end
|
||||
end
|
||||
|
||||
def remaining
|
||||
|
|
Loading…
Reference in New Issue