Class: MakandraSidekiq::SidekiqControl
- Inherits:
-
Object
- Object
- MakandraSidekiq::SidekiqControl
- Defined in:
- lib/makandra_sidekiq/sidekiq_control.rb
Constant Summary collapse
- CONFIG_PATH =
['config', 'sidekiq.yml']
Instance Method Summary collapse
-
#initialize(root) ⇒ SidekiqControl
constructor
A new instance of SidekiqControl.
- #quiet ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(root) ⇒ SidekiqControl
Returns a new instance of SidekiqControl.
13 14 15 16 |
# File 'lib/makandra_sidekiq/sidekiq_control.rb', line 13 def initialize(root) @root = Pathname.new(root) @config = load_config end |
Instance Method Details
#quiet ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/makandra_sidekiq/sidekiq_control.rb', line 18 def quiet if running? puts 'Preventing Sidekiq from accepting new jobs...' sidekiqctl_quiet else puts 'Sidekiq is not running.' end end |
#start ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/makandra_sidekiq/sidekiq_control.rb', line 36 def start if running? puts 'Sidekiq is already running.' else puts 'Starting Sidekiq...' patiently_start_sidekiq puts 'Done.' end end |
#stop ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/makandra_sidekiq/sidekiq_control.rb', line 27 def stop if running? puts 'Stopping Sidekiq...' sidekiqctl_stop else puts 'Sidekiq is not running.' end end |