Skip to content

Commit

Permalink
0 value added to cache key, instead of '0'; avoids error when increme…
Browse files Browse the repository at this point in the history
…nting the value
  • Loading branch information
guglielmo committed Nov 2, 2014
1 parent 2bb188e commit f7dde4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mapit/ratelimitcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def cache_incr(self, key):
try:
cache.incr(key)
except ValueError:
cache.add(key, '0', self.expire_after())
cache.add(key, 0, self.expire_after())
cache.incr(key)

def should_ratelimit(self, request):
Expand Down

0 comments on commit f7dde4c

Please sign in to comment.