fix error
This commit is contained in:
parent
3bb22a8853
commit
e2154d3946
|
@ -22,10 +22,8 @@ class Admin::RulingBusesController < OrbitAdminController
|
||||||
@ruling_bus_setting = RulingBusSetting.find(params[:id])
|
@ruling_bus_setting = RulingBusSetting.find(params[:id])
|
||||||
@ruling_bus_setting.update_attributes(ruling_bus_setting_params)
|
@ruling_bus_setting.update_attributes(ruling_bus_setting_params)
|
||||||
Thread.new do
|
Thread.new do
|
||||||
sleep 3
|
content = "UNICORN_PID=\"`fuser tmp/pids/unicorn.sock tmp/sockets/unicorn.sock tmp/unicorn.sock` `cat tmp/pids/unicorn.pid `\" && kill -s USR2 $UNICORN_PID ; n=20; while (kill -0 $UNICORN_PID > /dev/null 2>&1) && test $n -ge 0; do printf '.' && sleep 1 && n=$(( $n - 1 )); done ; if test $n -lt 0; then kill -s TERM $UNICORN_PID; sleep 3; bundle exec unicorn_rails -c config/unicorn.rb -D -E #{Rails.env}; else kill -s QUIT $UNICORN_PID; fi"
|
||||||
mode = Rails.env
|
system(content)
|
||||||
content = "UNICORN_PID=\"`fuser tmp/pids/unicorn.sock tmp/sockets/unicorn.sock tmp/unicorn.sock` `cat tmp/pids/unicorn.pid `\" && kill -s TERM $UNICORN_PID ; while (kill -0 $UNICORN_PID > /dev/null 2>&1) ; do printf '.' && sleep 1 ; done ; unset UNICORN_FD; bundle exec unicorn_rails -c config/unicorn.rb -D -E #{mode}"
|
|
||||||
system(content)
|
|
||||||
end
|
end
|
||||||
redirect_to (params[:referer_url].blank? ? "/#{I18n.locale}/admin/ruling_buses": params[:referer_url])
|
redirect_to (params[:referer_url].blank? ? "/#{I18n.locale}/admin/ruling_buses": params[:referer_url])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue