mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:01:18 +08:00
FIX: Killing a Unicorn worker shouldn't kill a running backup or restore process
By spawning and forking the backup and restore, the process owner changes from 🦄 to the init process.
This commit is contained in:

committed by
Gerhard Schlager

parent
1febf11362
commit
57095f0bb7
@ -172,9 +172,9 @@ module BackupRestore
|
||||
|
||||
def self.spawn_process!(type, user_id, opts)
|
||||
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].map(&:to_s)
|
||||
|
||||
pid = spawn({ "RAILS_DB" => RailsMultisite::ConnectionManagement.current_db }, command)
|
||||
pid = spawn({ "RAILS_DB" => RailsMultisite::ConnectionManagement.current_db }, *command)
|
||||
Process.detach(pid)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user