diff --git a/temp_file/app/controllers/admin/sites_controller.rb b/temp_file/app/controllers/admin/sites_controller.rb index 1dd57ac..fe99b81 100644 --- a/temp_file/app/controllers/admin/sites_controller.rb +++ b/temp_file/app/controllers/admin/sites_controller.rb @@ -196,9 +196,8 @@ class Admin::SitesController < OrbitAdminController def restart_server mode = Rails.env unicorn_rails = %x[which unicorn_rails].sub("\n",'') - Bundler.with_clean_env{system("kill -s TERM `cat tmp/pids/unicorn.pid` && unset UNICORN_FD && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}")} - sleep 2 render :nothing => true + Bundler.with_clean_env{system("kill -s TERM `cat tmp/pids/unicorn.pid` && unset UNICORN_FD && sleep 1 && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode}")} end private diff --git a/temp_file/playground_controller.rb b/temp_file/playground_controller.rb index 851ebfa..665e82e 100644 --- a/temp_file/playground_controller.rb +++ b/temp_file/playground_controller.rb @@ -172,7 +172,7 @@ class Admin::PlaygroundController < OrbitAdminController def restart_unicorn(mode) mode = Rails.env if mode.nil? unicorn_rails = %x[which unicorn_rails].sub("\n",'') - content = "kill -s TERM `cat tmp/pids/unicorn.pid` && unset UNICORN_FD && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode} | at now" + content = "kill -s TERM `cat tmp/pids/unicorn.pid` && unset UNICORN_FD && sleep 1 && bundle exec #{unicorn_rails} -c config/unicorn.rb -D -E #{mode} | at now" Thread.new do Bundler.with_clean_env{system(content)} end