From b6c81050d09c6d93b5586e8c0abb94f985f2a722 Mon Sep 17 00:00:00 2001 From: chiu Date: Sun, 8 Mar 2020 22:20:57 +0800 Subject: [PATCH] update update_manager --- temp_file/app/controllers/admin/sites_controller.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/temp_file/app/controllers/admin/sites_controller.rb b/temp_file/app/controllers/admin/sites_controller.rb index 74e9270..b467a4c 100644 --- a/temp_file/app/controllers/admin/sites_controller.rb +++ b/temp_file/app/controllers/admin/sites_controller.rb @@ -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 ."