mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-30 08:25:58 -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 {
|
if deleted > 0 {
|
||||||
log.Debugf(logPrefix+"Deleted %d stale sessions", deleted)
|
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 {
|
if err != nil {
|
||||||
log.Fatalf("Could not register session cleanup cron: %s", err)
|
log.Fatalf("Could not register session cleanup cron: %s", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user