Skip to content

A platform for community discussion. Free, open, simple.

FIX: Ensure multisite DB is set correctly when spawning backup process

David Taylorfe932eb644a4
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