From 22b04ae5a393eb8006c319c05085aa14ac1aeacf Mon Sep 17 00:00:00 2001 From: chiu Date: Sat, 15 Feb 2020 14:37:05 +0800 Subject: [PATCH] avoid server sometime will crash when using io.open to command --- temp_file/playground_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/temp_file/playground_controller.rb b/temp_file/playground_controller.rb index 66f6f6f..0324c7f 100644 --- a/temp_file/playground_controller.rb +++ b/temp_file/playground_controller.rb @@ -169,7 +169,9 @@ class Admin::PlaygroundController < OrbitAdminController mode = Rails.env if mode.nil? 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" - exec_other_command(content) + Thread.new do + Bundler.with_clean_env{system(content)} + end end def check_for_testers