Skip to content

Commit

Permalink
fix: cleanup panics due to bad inactivity timeout code (#1471)
Browse files Browse the repository at this point in the history
Code used `SessionTimebox` instead of `SessionInactivityTimeout`.
  • Loading branch information
hf authored Mar 6, 2024
1 parent c86007e commit 548edf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/models/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 548edf8

Please sign in to comment.