fix for restarting server

This commit is contained in:
Harry Bomrah 2014-12-31 16:41:47 +08:00
parent ceca2c58c0
commit 12107376b6
2 changed files with 6 additions and 7 deletions

View File

@ -32,7 +32,7 @@ class StoreApiController < ApplicationController
render :json => response.to_json
if response["success"]
bundle_install
give_permissions(params[:module_key])
# give_permissions(params[:module_key])
end
end
@ -57,14 +57,12 @@ class StoreApiController < ApplicationController
sleep 5
end
def give_permissions(key)
ma = ModuleApp.find_by_key(key) rescue nil
if !ma.nil?
ma.store_permission_granted = true
ma.save
end
def restart_server_after_install
%x(kill -s USR2 `cat tmp/pids/unicorn.pid`)
sleep 5
end
def download_template(url,name)
dir = File.join(Rails.root,"public","template_cache")
destination = File.join(Rails.root,"app","templates","#{Site.first.template}","modules")

View File

@ -30,6 +30,7 @@ Orbit::Application.routes.draw do
post "/store/confirmation" => "store_api#confirmation"
post "/store/install_module" => "store_api#install_module"
post "/store/uninstall_module" => "store_api#uninstall_module"
post "/store/restart_srever_after_install" => "store_api#restart_server_after_install"
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".