avoid server sometime will crash when using io.open to command

This commit is contained in:
chiu 2020-02-15 14:37:05 +08:00
parent b8972a0ef9
commit 22b04ae5a3
1 changed files with 3 additions and 1 deletions

View File

@ -169,7 +169,9 @@ class Admin::PlaygroundController < OrbitAdminController
mode = Rails.env if mode.nil? mode = Rails.env if mode.nil?
unicorn_rails = %x[which unicorn_rails].sub("\n",'') unicorn_rails = %x[which unicorn_rails].sub("\n",'')
content = "kill -s TERM `cat tmp/pids/unicorn.pid` && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode} | at now" content = "kill -s TERM `cat tmp/pids/unicorn.pid` && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode} | at now"
exec_other_command(content) Thread.new do
Bundler.with_clean_env{system(content)}
end
end end
def check_for_testers def check_for_testers