mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Ignore Redis readonly errors in RateLimiter#rollback!.
This is similar to what we're doing in `RateLimiter#performed!`.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user