update manager fix

This commit is contained in:
Harry Bomrah 2014-12-01 19:32:09 +08:00
parent 4b13800007
commit 0526b5f9e7
1 changed files with 9 additions and 1 deletions

View File

@ -105,7 +105,8 @@ class Admin::SitesController < OrbitAdminController
result = "failed"
else
result = "success"
Bundler.with_clean_env { `cd #{Rails.root} && bundle install` }
p1 = fork { bundle_install }
Process.detach(p1)
end
render :text => result
@ -114,6 +115,13 @@ class Admin::SitesController < OrbitAdminController
end
end
def bundle_install
Bundler.with_clean_env { `cd #{Rails.root} && bundle install` }
%x(kill -s USR2 `cat tmp/pids/unicorn.pid`)
sleep 5
render :nothing => true
end
def restart_server
%x(kill -s USR2 `cat tmp/pids/unicorn.pid`)
sleep 5