clean faster
This commit is contained in:
parent
0230a6ce4e
commit
87f2e08227
@ -102,7 +102,7 @@ func (s *Service) CurrentSession(c *gin.Context) *Session {
|
||||
|
||||
func (s *Service) SessionCleaner() {
|
||||
for range time.Tick(time.Minute) {
|
||||
t := time.Now().UTC().Add(-3 * time.Hour).Truncate(time.Minute)
|
||||
t := time.Now().UTC().Add(-30 * time.Minute).Truncate(time.Minute)
|
||||
// s.LogOk.Printf("Session", "Cleaning old session < %s", t)
|
||||
if err := s.DB.Where("updated_at < ?", t).Delete(&Session{}).Error; err != nil {
|
||||
s.LogErr.Printf("Session", "Cleaning failed: %s", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user