mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fixing error on committing to cache for rate limits when the dummy cache backend is used.
This commit is contained in:
parent
8865f6fbfd
commit
a7b8233727
1 changed files with 1 additions and 1 deletions
|
@ -46,7 +46,7 @@ class ratelimit(object):
|
|||
# add first, to ensure the key exists
|
||||
cache.add(key, 0, self.expire_after())
|
||||
cache.incr(key)
|
||||
except AttributeError:
|
||||
except (AttributeError, ValueError):
|
||||
cache.set(key, cache.get(key, 0) + 1, self.expire_after())
|
||||
|
||||
def should_ratelimit(self, request):
|
||||
|
|
Loading…
Add table
Reference in a new issue