From 548edf898161c9ba9a136fc99ec2d52a8ba1f856 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Wed, 6 Mar 2024 10:50:09 +0100 Subject: [PATCH] fix: cleanup panics due to bad inactivity timeout code (#1471) Code used `SessionTimebox` instead of `SessionInactivityTimeout`. --- internal/models/cleanup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/models/cleanup.go b/internal/models/cleanup.go index 5bec1962a..d76a8de25 100644 --- a/internal/models/cleanup.go +++ b/internal/models/cleanup.go @@ -62,7 +62,7 @@ func (c *Cleanup) Setup() { } if c.SessionInactivityTimeout != nil { - inactivitySeconds := int((*c.SessionTimebox).Seconds()) + inactivitySeconds := int((*c.SessionInactivityTimeout).Seconds()) // delete sessions with a refreshed_at column c.cleanupStatements = append(c.cleanupStatements, fmt.Sprintf("delete from %q where id in (select id from %q where refreshed_at is not null and refreshed_at + interval '%d seconds' < now() - interval '24 hours' limit 100 for update skip locked);", tableSessions, tableSessions, inactivitySeconds))