Attempt to fix redis limiter nonetype return

This commit is contained in:
Jeremy Zhang 2017-04-23 17:59:13 -07:00
parent 13b69d7e2d
commit 8d50f4fa0f

View File

@ -26,7 +26,10 @@ class LimitsRedisLite(Storage): # For Python Limits
return int(self.get(key)) return int(self.get(key))
def get(self, key): def get(self, key):
return int(self.redis_instance.get(key)) value = self.redis_instance.get(key)
if value:
return int(value)
return 0
def reset(self): def reset(self):
return self.redis_instance.flushdb() return self.redis_instance.flushdb()