web/application.py
changeset 5736 375819ec7d43
parent 5722 61d6a4caa963
parent 5721 3a9cd70bcfdc
child 5868 c4380d8cfc25
equal deleted inserted replaced
5728:12d3da7b3bcf 5736:375819ec7d43
    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