diff --git a/backend/server/internal/database/db.go b/backend/server/internal/database/db.go index d618395..9b8f200 100644 --- a/backend/server/internal/database/db.go +++ b/backend/server/internal/database/db.go @@ -399,7 +399,7 @@ func (db *DB) DeepClean(ctx context.Context) error { return r.Error } r = tx.Exec(` - SELECT COUNT(*) FROM enc_history_entries WHERE + DELETE FROM enc_history_entries WHERE date <= (now() - INTERVAL '180 days') AND user_id IN (SELECT * FROM temp_users_with_one_device) AND user_id IN (SELECT * FROM temp_inactive_users) diff --git a/backend/server/internal/server/srv.go b/backend/server/internal/server/srv.go index e24d49a..723c2d7 100644 --- a/backend/server/internal/server/srv.go +++ b/backend/server/internal/server/srv.go @@ -90,7 +90,7 @@ func (s *Server) Run(ctx context.Context, addr string) error { defer configureObservability(mux, s.releaseVersion)() go func() { if err := s.db.DeepClean(ctx); err != nil { - panic(err) + fmt.Println("failed to deep clean: %w", err) } }() }