mirror of
https://github.com/go-gitea/gitea
synced 2025-01-27 18:14:28 +00:00
Backport #15697 The DB session clean up needs to check expiry not created_unix. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
15886ce048
commit
3ce46a7fbd
@ -117,6 +117,6 @@ func CountSessions() (int64, error) {
|
|||||||
|
|
||||||
// CleanupSessions cleans up expired sessions
|
// CleanupSessions cleans up expired sessions
|
||||||
func CleanupSessions(maxLifetime int64) error {
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user