update update_manager

This commit is contained in:
chiu 2020-03-08 22:20:57 +08:00
parent 8b05282dbe
commit b6c81050d0
1 changed files with 9 additions and 2 deletions

View File

@ -21,7 +21,14 @@ class Admin::SitesController < OrbitAdminController
http = Net::HTTP.new(uri.host,uri.port)
request = Net::HTTP::Get.new("/site/send_email")
request.body = params_to_send.to_query
response = http.request(request)
http.open_timeout = 1 #set read_timeout to 1 second to avoid web die caused by no response
http.ssl_timeout = 1
begin
response = http.request(request)
rescue
response = ActionDispatch::Response.new
response.body = {'success'=>true}.to_json
end
data = JSON.parse(response.body)
%x(kill -s USR2 `cat tmp/pids/unicorn.pid`)
sleep 5
@ -170,7 +177,7 @@ class Admin::SitesController < OrbitAdminController
git_add_except_public = Dir['*'].select{|v| v!= 'public' && v!= 'log'}.collect do |v|
"#{git} add -f --all --ignore-errors '#{v}'"
end.join(' ; ')
git_add_custom = (Dir['*'].select{|v| v !='app' && v != 'lib' && v != 'config' && v != 'public' && v!= 'log'} + ['app/templates','config/mongoid.yml']).collect do |v|
git_add_custom = (Dir['*'].select{|v| v !='app' && v != 'lib' && v != 'config' && v != 'public' && v!= 'log'} + ['app/templates','config/mongoid.yml','config/extra_lang.txt']).collect do |v|
"#{git} add -f --all --ignore-errors '#{v}'"
end.join(' ; ')
git_restore = "#{git} checkout ."