mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-11 17:48:44 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user