session_db: use SESSION_LIFETIME constant

pull/2441/head
Stéphane Bidoul 2022-10-29 15:36:13 +02:00
parent 6ff5bb8e03
commit b68adf53a2
1 changed files with 2 additions and 1 deletions

View File

@ -106,7 +106,8 @@ class PGSessionStore(sessions.SessionStore):
def vacuum(self): def vacuum(self):
self._cr.execute( self._cr.execute(
"DELETE FROM http_sessions " "DELETE FROM http_sessions "
"WHERE now() at time zone 'UTC' - write_date > '7 days'" "WHERE now() at time zone 'UTC' - write_date > %s",
(f"{http.SESSION_LIFETIME} seconds",),
) )