diff options
author | zeripath <art27@cantab.net> | 2021-05-02 03:51:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-01 22:51:03 -0400 |
commit | 6ebd833780c97da7b065ad9d3b49d70d7dcdbbd4 (patch) | |
tree | 9f632f2015cd39d19cf335ab1dd4fb4545f92cef /models | |
parent | a926ff919db105f7ceed63bb858b6b80d96157dc (diff) | |
download | gitea-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.go | 2 |
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 } |