Commit 45fecff2 by Karl Kloppenborg

allow run_config stop and quiet

parent 52c10099
......@@ -63,6 +63,9 @@ namespace :sneakers do
end
def stop_sneakers(pid_file)
if fetch(:sneakers_run_config) == true
execute "kill -SIGTERM `cat #{pid_file}`"
else
if fetch(:stop_sneakers_in_background, fetch(:sneakers_run_in_background))
if fetch(:sneakers_use_signals)
background "kill -TERM `cat #{pid_file}`"
......@@ -73,9 +76,10 @@ namespace :sneakers do
execute :bundle, :exec, :sneakersctl, 'stop', "#{pid_file}", fetch(:sneakers_timeout)
end
end
end
def quiet_sneakers(pid_file)
if fetch(:sneakers_use_signals)
if fetch(:sneakers_use_signals) || fetch(:sneakers_run_config)
background "kill -USR1 `cat #{pid_file}`"
else
begin
......@@ -88,7 +92,6 @@ namespace :sneakers do
end
def start_sneakers(pid_file, idx = 0)
args = []
if fetch(:sneakers_run_config) == true
# Use sneakers configuration prebuilt in
raise "[ set :workers, ['worker1', 'workerN'] ] not configured properly, please configure the workers you wish to use" if fetch(:sneakers_workers).nil? or fetch(:sneakers_workers) == false or !fetch(:sneakers_workers).kind_of? Array
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment