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:
parent
b424508be1
commit
dc06a550e4
1 changed files with 10 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue