From 8fc534b5d6b1e35989774f9bf002996fb021ab5e Mon Sep 17 00:00:00 2001 From: Christoph Fiehe Date: Wed, 16 Aug 2023 11:37:03 +0200 Subject: [PATCH] Fixes the issue "PGSessionStore.vacuum() got an unexpected keyword argument 'max_lifetime'" when autovacuum gets executed. Signed-off-by: Christoph Fiehe --- session_db/pg_session_store.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/session_db/pg_session_store.py b/session_db/pg_session_store.py index cf2dd607d..ad47eb4fe 100644 --- a/session_db/pg_session_store.py +++ b/session_db/pg_session_store.py @@ -142,11 +142,11 @@ class PGSessionStore(sessions.SessionStore): @with_lock @with_cursor - def vacuum(self): + def vacuum(self, max_lifetime=http.SESSION_LIFETIME): self._cr.execute( "DELETE FROM http_sessions " "WHERE now() at time zone 'UTC' - write_date > %s", - (f"{http.SESSION_LIFETIME} seconds",), + (f"{max_lifetime} seconds",), )