commit
8cb6f2c1b4
|
@ -142,11 +142,11 @@ class PGSessionStore(sessions.SessionStore):
|
||||||
|
|
||||||
@with_lock
|
@with_lock
|
||||||
@with_cursor
|
@with_cursor
|
||||||
def vacuum(self):
|
def vacuum(self, max_lifetime=http.SESSION_LIFETIME):
|
||||||
self._cr.execute(
|
self._cr.execute(
|
||||||
"DELETE FROM http_sessions "
|
"DELETE FROM http_sessions "
|
||||||
"WHERE now() at time zone 'UTC' - write_date > %s",
|
"WHERE now() at time zone 'UTC' - write_date > %s",
|
||||||
(f"{http.SESSION_LIFETIME} seconds",),
|
(f"{max_lifetime} seconds",),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue