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

Followup to 76477a1c8b
This commit is contained in:
David Taylor 2020-09-18 20:06:49 +01:00
parent c664ba8fa8
commit fe932eb644
No known key found for this signature in database
GPG Key ID: 46904C18B1D3F434
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ module BackupRestore
script = File.join(Rails.root, "script", "spawn_backup_restore.rb") script = File.join(Rails.root, "script", "spawn_backup_restore.rb")
command = ["bundle", "exec", "ruby", script, type, user_id, opts.to_json].shelljoin 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) Process.detach(pid)
end end