Skip to content

Commit

Permalink
Merge branch 'swatinem/bulk-cleanups' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Jan 22, 2025
2 parents 82859dd + 15aea8b commit f8dc5f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/cleanup/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def run_cleanup(

with cleanup_context() as context:
for model, query in models_to_cleanup:
# This is needed so that the correct connection is chosen for the
# `_raw_delete` queries, as otherwise it might chose a readonly connection.
query._for_write = True

manual_cleanup = MANUAL_CLEANUP.get(model)
if manual_cleanup is not None:
result = manual_cleanup(context, query)
Expand Down

0 comments on commit f8dc5f4

Please sign in to comment.