Decode value in getbucket after checking that it is not none

This commit is contained in:
Jeremy Zhang 2017-12-29 17:44:10 +00:00
parent 348580dcbb
commit 9a258be2d7

View File

@ -25,7 +25,9 @@ class DiscordREST:
self._set_bucket("global_limit_expire", 0)
def _get_bucket(self, key):
value = redis_store.get(self.global_redis_prefix + key).decode("utf-8")
value = redis_store.get(self.global_redis_prefix + key)
if value:
value = value.decode("utf-8")
return value
def _set_bucket(self, key, value):