mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:59:50 +08:00
DEV: Allow skipping failed migrations when running S3 migration
Use the SKIP_FAILED environment variable to skip failed sites. Use with caution - make sure you go back and re-run the failed migrations afterwards.
This commit is contained in:
parent
a15cca9a0f
commit
31902159af
|
@ -209,7 +209,16 @@ task "uploads:migrate_to_s3" => :environment do
|
|||
end
|
||||
|
||||
def migrate_to_s3_all_sites
|
||||
RailsMultisite::ConnectionManagement.each_connection { migrate_to_s3 }
|
||||
RailsMultisite::ConnectionManagement.each_connection do
|
||||
begin
|
||||
migrate_to_s3
|
||||
rescue e
|
||||
if ENV["SKIP_FAILED"]
|
||||
puts e
|
||||
else
|
||||
raise e unless ENV["SKIP_FAILED"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def migration_successful?(db, should_raise = false)
|
||||
|
|
Loading…
Reference in New Issue
Block a user