##// END OF EJS Templates
release: Finish preparation for 4.27.0
release: Finish preparation for 4.27.0

File last commit:

r4484:7bc1ace5 default
r4773:6cea3037 v4.27.0 stable
Show More
patch-beaker-improved-redis.diff
26 lines | 1.0 KiB | text/x-diff | DiffLexer
/ pkgs / patches / beaker / patch-beaker-improved-redis.diff
diff -rup Beaker-1.9.1-orig/beaker/ext/redisnm.py Beaker-1.9.1/beaker/ext/redisnm.py
--- Beaker-1.9.1-orig/beaker/ext/redisnm.py 2018-04-10 10:23:04.000000000 +0200
+++ Beaker-1.9.1/beaker/ext/redisnm.py 2018-04-10 10:23:34.000000000 +0200
@@ -30,9 +30,10 @@ class RedisNamespaceManager(NamespaceManager):
clients = SyncDict()
- def __init__(self, namespace, url, **kw):
+ def __init__(self, namespace, url, timeout=None, **kw):
super(RedisNamespaceManager, self).__init__(namespace)
self.lock_dir = None # Redis uses redis itself for locking.
+ self.timeout = timeout
if redis is None:
raise RuntimeError('redis is not available')
@@ -68,6 +69,8 @@ def has_key(self, key):
def set_value(self, key, value, expiretime=None):
value = pickle.dumps(value)
+ if expiretime is None and self.timeout is not None:
+ expiretime = self.timeout
if expiretime is not None:
self.client.setex(self._format_key(key), int(expiretime), value)
else: