mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
20 lines
406 B
Ruby
Executable file
20 lines
406 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
|
|
require 'fileutils'
|
|
require 'sidekiq/api'
|
|
require 'sidekiq/ctl'
|
|
|
|
if ARGV[0] == 'status'
|
|
Sidekiq::Ctl::Status.new.display(ARGV[1])
|
|
else
|
|
if ARGV.length < 2
|
|
Sidekiq::Ctl.print_usage
|
|
else
|
|
stage = ARGV[0]
|
|
pidfile = ARGV[1]
|
|
timeout = ARGV[2].to_i
|
|
timeout = Sidekiq::Ctl::DEFAULT_KILL_TIMEOUT if timeout == 0
|
|
|
|
Sidekiq::Ctl.new(stage, pidfile, timeout)
|
|
end
|
|
end
|