Update deep clean code to actually execute the delete now that I validated that it is reasonable

This commit is contained in:
David Dworken 2023-10-28 15:06:58 -07:00
parent 0c39dbf27c
commit f3c8ecc9e6
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)
}
}()
}