Skip to content

Commit 6ebd833

Browse files
zeripath6543
andauthored
Fix DB session cleanup (#15697)
The DB session clean up needs to check expiry not created_unix. Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent a926ff9 commit 6ebd833

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@ func CountSessions() (int64, error) {
117117

118118
// CleanupSessions cleans up expired sessions
119119
func CleanupSessions(maxLifetime int64) error {
120-
_, err := x.Where("created_unix <= ?", timeutil.TimeStampNow().Add(-maxLifetime)).Delete(&Session{})
120+
_, err := x.Where("expiry <= ?", timeutil.TimeStampNow().Add(-maxLifetime)).Delete(&Session{})
121121
return err
122122
}

0 commit comments

Comments
 (0)