import threading, time, pickle, random, os
-from . import cookie, env, proto
+import cookie, env, proto
__all__ = ["db", "get"]
def clean(self):
now = int(time.time())
with self.lock:
- clist = list(self.live.keys())
+ clist = self.live.keys()
for sessid in clist:
with self.lock:
try:
data = self.backdb[sessid]
try:
return pickle.loads(data)
- except:
+ except Exception, e:
raise KeyError()
def freeze(self, sess):