[web] fix AbstractSessionManager.clean_sessions (closes #5757240)
sessions were not closed if "last_usage_time = session.cnx.check()" actually
raises an AtributeError.
--- a/web/views/sessions.py Tue Jul 21 14:29:42 2015 +0200
+++ b/web/views/sessions.py Tue Jul 28 11:21:36 2015 +0200
@@ -60,15 +60,16 @@
except BadConnectionId:
self.close_session(session)
closed += 1
- else:
- no_use_time = (time() - last_usage_time)
- if session.anonymous_session:
- if no_use_time >= self.cleanup_anon_session_time:
- self.close_session(session)
- closed += 1
- elif session_time is not None and no_use_time >= session_time:
+ continue
+
+ no_use_time = (time() - last_usage_time)
+ if session.anonymous_session:
+ if no_use_time >= self.cleanup_anon_session_time:
self.close_session(session)
closed += 1
+ elif session_time is not None and no_use_time >= session_time:
+ self.close_session(session)
+ closed += 1
return closed, total - closed
def current_sessions(self):