A platform for community discussion. Free, open, simple.
DEV: Skip s3 asset deletion when in readonly mode (#19611)
David Tayloreebe2f256ccd
diff --git a/lib/tasks/s3.rake b/lib/tasks/s3.rakeindex d2a21fed37d..9a3b61c5d23 100644--- a/lib/tasks/s3.rake+++ b/lib/tasks/s3.rake@@ -206,6 +206,11 @@ task 's3:expire_missing_assets' => :environment doputs "Checking for stale S3 assets..."+ if Discourse.readonly_mode?+ puts "Discourse is in readonly mode. Skipping s3 asset deletion in case this is a read-only mirror of a live site."+ exit 0+ end+assets_to_delete = existing_assets.dup# Check that all current assets are uploaded, and remove them from the to_delete list