1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Add quiet and stop in a single command (finish and exit)

This commit is contained in:
James Miller 2012-03-28 09:45:58 -07:00
parent b424508be1
commit dc06a550e4

View file

@ -24,10 +24,11 @@ rescue Errno::ESRCH
done "Process doesn't exist"
end
case stage
when 'quiet'
def quiet
`kill -USR1 #{pid}`
when 'stop'
end
def stop
`kill -TERM #{pid}`
timeout.times do
begin
@ -41,3 +42,9 @@ when 'stop'
`kill -9 #{pid}`
done 'Sidekiq shut down forcefully.'
end
case stage
when 'quiet' then quiet
when 'stop' then stop
when 'quiet_and_stop' then quiet && stop
end