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