mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:06:26 +08:00
FIX: Don't optimize icons during db:migrate when restoring backup
Uploads are extracted after the DB migration, so this could lead to a failure during the restore. Site icons get optimized after extracting uploads.
This commit is contained in:
parent
5c581b475a
commit
8fa8bab9ff
|
@ -134,7 +134,7 @@ module BackupRestore
|
|||
log "Migrating the database..."
|
||||
|
||||
log Discourse::Utils.execute_command(
|
||||
{ "SKIP_POST_DEPLOYMENT_MIGRATIONS" => "0" },
|
||||
{ "SKIP_POST_DEPLOYMENT_MIGRATIONS" => "0", "SKIP_OPTIMIZE_ICONS" => "1" },
|
||||
"rake db:migrate",
|
||||
failure_message: "Failed to migrate database.",
|
||||
chdir: Rails.root
|
||||
|
|
|
@ -77,7 +77,7 @@ task 'db:migrate' => ['load_config', 'environment', 'set_locale'] do |_, args|
|
|||
|
||||
SeedFu.seed(DiscoursePluginRegistry.seed_paths)
|
||||
|
||||
if !Discourse.skip_post_deployment_migrations?
|
||||
if !Discourse.skip_post_deployment_migrations? && ENV['SKIP_OPTIMIZE_ICONS'] != '1'
|
||||
puts
|
||||
print "Optimizing site icons... "
|
||||
SiteIconManager.ensure_optimized!
|
||||
|
|
|
@ -37,6 +37,7 @@ describe BackupRestore::DatabaseRestorer do
|
|||
def expect_db_migrate
|
||||
Discourse::Utils.expects(:execute_command).with do |env, command, options|
|
||||
env["SKIP_POST_DEPLOYMENT_MIGRATIONS"] == "0" &&
|
||||
env["SKIP_OPTIMIZE_ICONS"] == "1" &&
|
||||
command == "rake db:migrate" &&
|
||||
options[:chdir] == Rails.root
|
||||
end.once
|
||||
|
|
Loading…
Reference in New Issue
Block a user