Conflicts:
wrw/session.py
def clean(self):
now = int(time.time())
with self.lock:
- dlist = []
- for sess in self.live.values():
- if sess.atime + self.freezetime < now:
- try:
- if sess.dirty():
- self.freeze(sess)
- except:
- if sess.atime + sess.expire < now:
- dlist.append(sess)
- else:
- dlist.append(sess)
- for sess in dlist:
- del self.live[sess.id]
- clist = self.live.keys()
++ clist = list(self.live.keys())
+ for sessid in clist:
+ with self.lock:
+ try:
+ entry = self.live[sessid]
+ except KeyError:
+ continue
+ with entry[0]:
+ rm = False
+ if entry[1] == "retired":
+ pass
+ elif entry[1] is None:
+ pass
+ else:
+ sess = entry[1]
+ if sess.atime + self.freezetime < now:
+ try:
+ if sess.dirty():
+ self.freeze(sess)
+ except:
+ if sess.atime + sess.expire < now:
+ rm = True
+ else:
+ rm = True
+ if rm:
+ entry[1] = "retired"
+ with self.lock:
+ del self.live[sessid]
def cleanloop(self):
try: