Commits

Preston M. committed 8fc5130

memcached backend try use expire from the cache value

Comments (0)

Files changed (1)

beaker/ext/memcached.py

         return key in self
 
     def set_value(self, key, value, expiretime=None):
+        if expiretime is None and type(value) is tuple:
+            try:
+                expiretime = int(value[1])
+            except KeyError:
+                pass
+
         if expiretime:
             self.mc.set(self._format_key(key), value, time=expiretime)
         else: