summaryrefslogtreecommitdiffstats
path: root/nfsw/redis.py
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-09-30 18:24:11 -0400
committerrsiddharth <s@ricketyspace.net>2019-09-30 18:24:11 -0400
commit4220a7a830aa82761452dbafeb6cc9cfc004b6dd (patch)
tree95e6a61ed4cd75d8c43eee0b7f4dd2b508ad1b10 /nfsw/redis.py
parent2bc5665e2a276876b5ac874fbdbb80cd8519e476 (diff)
nfsw/redis.py: Add redisc.
Sets RedisC instance in global app variable g. redisc is pronounced as 'redis see'.
Diffstat (limited to 'nfsw/redis.py')
-rw-r--r--nfsw/redis.py9
1 files changed, 9 insertions, 0 deletions
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