mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-08 01:06:34 +00:00
Merge branch 'main' into feat/access-log
This commit is contained in:
@@ -383,8 +383,7 @@ func (app *BootstrapApp) dbCleanup(db *gorm.DB) {
|
||||
|
||||
for ; true; <-ticker.C {
|
||||
log.Debug().Msg("Cleaning up old database sessions")
|
||||
rows, err := gorm.G[model.Session](db).Where("expiry < ?", time.Now().UnixMilli()).Delete(ctx)
|
||||
log.Debug().Int("rows_affected", rows).Msg("Old sessions cleanup completed")
|
||||
_, err := gorm.G[model.Session](db).Where("expiry < ?", time.Now().Unix()).Delete(ctx)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to cleanup old sessions")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user