aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-05-02 03:51:03 +0100
committerGitHub <noreply@github.com>2021-05-01 22:51:03 -0400
commit6ebd833780c97da7b065ad9d3b49d70d7dcdbbd4 (patch)
tree9f632f2015cd39d19cf335ab1dd4fb4545f92cef /models
parenta926ff919db105f7ceed63bb858b6b80d96157dc (diff)
downloadgitea-6ebd833780c97da7b065ad9d3b49d70d7dcdbbd4.tar.gz
gitea-6ebd833780c97da7b065ad9d3b49d70d7dcdbbd4.zip
Fix DB session cleanup (#15697)
The DB session clean up needs to check expiry not created_unix. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'models')
-rw-r--r--models/session.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/session.go b/models/session.go
index fe363ee487..b2e4837bed 100644
--- a/models/session.go
+++ b/models/session.go
@@ -117,6 +117,6 @@ func CountSessions() (int64, error) {
// CleanupSessions cleans up expired sessions
func CleanupSessions(maxLifetime int64) error {
- _, err := x.Where("created_unix <= ?", timeutil.TimeStampNow().Add(-maxLifetime)).Delete(&Session{})
+ _, err := x.Where("expiry <= ?", timeutil.TimeStampNow().Add(-maxLifetime)).Delete(&Session{})
return err
}