(queries *repository.Queries)
| 289 | } |
| 290 | |
| 291 | func (app *BootstrapApp) dbCleanupRoutine(queries *repository.Queries) { |
| 292 | ticker := time.NewTicker(time.Duration(30) * time.Minute) |
| 293 | defer ticker.Stop() |
| 294 | ctx := context.Background() |
| 295 | |
| 296 | for range ticker.C { |
| 297 | tlog.App.Debug().Msg("Cleaning up old database sessions") |
| 298 | err := queries.DeleteExpiredSessions(ctx, time.Now().Unix()) |
| 299 | if err != nil { |
| 300 | tlog.App.Error().Err(err).Msg("Failed to clean up old database sessions") |
| 301 | } |
| 302 | } |
| 303 | } |
no test coverage detected