From 4220a7a830aa82761452dbafeb6cc9cfc004b6dd Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Mon, 30 Sep 2019 18:24:11 -0400 Subject: nfsw/redis.py: Add redisc. Sets RedisC instance in global app variable g. redisc is pronounced as 'redis see'. --- nfsw/redis.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'nfsw/redis.py') diff --git a/nfsw/redis.py b/nfsw/redis.py index 6ae2bd9..056a385 100644 --- a/nfsw/redis.py +++ b/nfsw/redis.py @@ -35,6 +35,15 @@ def key(prefix): return prefix +def redisc(): + if 'redisc' in g: + return g.redisc + + g.redisc = RedisC() + + return g.redisc + + class RedisC: r = None -- cgit v1.2.3