MCPcopy
hub / github.com/tinyauthapp/tinyauth / dbCleanupRoutine

Method dbCleanupRoutine

internal/bootstrap/app_bootstrap.go:291–303  ·  view source on GitHub ↗
(queries *repository.Queries)

Source from the content-addressed store, hash-verified

289}
290
291func (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}

Callers 1

SetupMethod · 0.95

Calls 1

DeleteExpiredSessionsMethod · 0.80

Tested by

no test coverage detected