Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def set(self, key, value, ttl=0):
if value is None:
return
key = self.key_name(key)
value = json.dumps(value)
self.mc.set(key, value, ttl)
def set(self, key, value, ttl=None):
if value is None:
return
key = self.key_name(key)
value = json.dumps(value)
self.redis.set(key, value, ex=ttl)