web/application.py
branchstable
changeset 5721 3a9cd70bcfdc
parent 5650 86e874fe30ea
child 5736 375819ec7d43
child 5865 af414723598d
equal deleted inserted replaced
5711:ea2538a3c622 5721:3a9cd70bcfdc
    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