fix: commit transaction in session cleanup cron

RegisterSessionCleanupCron opens a transaction via db.NewSession() but
never calls s.Commit(). The deferred s.Close() auto-rolls-back, making
the DELETE a no-op. Add the missing commit.
This commit is contained in:
kolaente
2026-02-25 10:48:21 +01:00
parent 2f680d041c
commit 107a92f573

View File

@@ -230,6 +230,10 @@ func RegisterSessionCleanupCron() {
if deleted > 0 {
log.Debugf(logPrefix+"Deleted %d stale sessions", deleted)
}
if err := s.Commit(); err != nil {
log.Errorf(logPrefix+"Could not commit: %s", err)
}
})
if err != nil {
log.Fatalf("Could not register session cleanup cron: %s", err)