added media fixes, search, push updates, pwa, metrics. preparing release 1.0
CI / Go (build + vet + test) (push) Canceled after 0s
CI / Web (build + lint) (push) Canceled after 0s

This commit is contained in:
vantablackTea
2026-09-27 23:26:15 +03:00
parent 855a62755c
commit 6fc6d977bf
59 changed files with 6823 additions and 113 deletions
+13
View File
@@ -65,3 +65,16 @@ func (s *Store) RevokeAllSessions(ctx context.Context, userID int64) error {
`, userID)
return err
}
// CleanupSessions removes expired sessions and revocations older than a week.
func (s *Store) CleanupSessions(ctx context.Context) (int64, error) {
tag, err := s.pool.Exec(ctx, `
DELETE FROM sessions
WHERE expires_at < now()
OR (revoked_at IS NOT NULL AND revoked_at < now() - interval '7 days')
`)
if err != nil {
return 0, err
}
return tag.RowsAffected(), nil
}