equal
deleted
inserted
replaced
57 assert self.cleanup_session_time > 0 |
57 assert self.cleanup_session_time > 0 |
58 self.cleanup_anon_session_time = vreg.config['cleanup-anonymous-session-time'] or 5 * 60 |
58 self.cleanup_anon_session_time = vreg.config['cleanup-anonymous-session-time'] or 5 * 60 |
59 assert self.cleanup_anon_session_time > 0 |
59 assert self.cleanup_anon_session_time > 0 |
60 self.authmanager = vreg['components'].select('authmanager', vreg=vreg) |
60 self.authmanager = vreg['components'].select('authmanager', vreg=vreg) |
61 if vreg.config.anonymous_user() is not None: |
61 if vreg.config.anonymous_user() is not None: |
62 self.clean_sessions_interval = min( |
62 self.clean_sessions_interval = max( |
63 5 * 60, |
63 5 * 60, min(self.cleanup_session_time / 2., |
64 self.cleanup_session_time / 2., |
64 self.cleanup_anon_session_time / 2.)) |
65 self.cleanup_anon_session_time / 2.) |
|
66 else: |
65 else: |
67 self.clean_sessions_interval = min( |
66 self.clean_sessions_interval = max( |
68 5 * 60, |
67 5 * 60, |
69 self.cleanup_session_time / 2.) |
68 self.cleanup_session_time / 2.) |
70 |
69 |
71 def clean_sessions(self): |
70 def clean_sessions(self): |
72 """cleanup sessions which has not been unused since a given amount of |
71 """cleanup sessions which has not been unused since a given amount of |