forked from saurabh/orbit4-5
fix for restarting server
This commit is contained in:
parent
ceca2c58c0
commit
12107376b6
|
@ -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")
|
||||
|
|
|
@ -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".
|
||||
|
|
Loading…
Reference in New Issue