From fe932eb644a47ea3e2aa4bf7f0ab101af7a2c792 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 18 Sep 2020 20:06:49 +0100 Subject: [PATCH] FIX: Ensure multisite DB is set correctly when spawning backup process Followup to 76477a1c8b2a51c49b8af878cf3286e9a12ae5fc --- lib/backup_restore.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/backup_restore.rb b/lib/backup_restore.rb index 3643cceea19..6528b1728e9 100644 --- a/lib/backup_restore.rb +++ b/lib/backup_restore.rb @@ -174,7 +174,7 @@ module BackupRestore script = File.join(Rails.root, "script", "spawn_backup_restore.rb") command = ["bundle", "exec", "ruby", script, type, user_id, opts.to_json].shelljoin - pid = spawn(command) + pid = spawn({ "RAILS_DB" => RailsMultisite::ConnectionManagement.current_db }, command) Process.detach(pid) end