Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Patch from iuridiniz, fetch expiretime from Value object. Apparently …

…expiretime keyword-argument is never set. Why?
  • Loading branch information...
commit 88ca1ece9ae6af6cc39fedd35455d87e6fabab4c 1 parent af0728d
@didip authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 beaker_extensions/redis_.py
View
8 beaker_extensions/redis_.py
@@ -25,6 +25,14 @@ def __contains__(self, key):
def set_value(self, key, value, expiretime=None):
key = self._format_key(key)
+
+ #XXX: beaker.container.Value.set_value calls NamespaceManager.set_value
+ # however it(until version 1.6.3) never sets expiretime param. Why?
+ # Fortunately we can access expiretime through value.
+ # >>> value = list(storedtime, expire_argument, real_value)
+ if expiretime is None:
+ expiretime = value[1]
+
if expiretime:
self.db_conn.setex(key, expiretime, pickle.dumps(value))
else:
Please sign in to comment.
Something went wrong with that request. Please try again.