ColdCore/utils/cache.py

12 lines
226 B
Python
Raw Normal View History

2015-11-10 16:51:45 +00:00
import json
from flask import g
def get_complex(key):
i = g.redis.get(key)
if i is None:
return None
return json.loads(i.decode())
def set_complex(key, val, ex):
g.redis.set(key, json.dumps(val), ex)