Module: Sidekiq::Cron::Launcher

Defined in:
lib/sidekiq/cron/launcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cron_pollerObject (readonly)

Add cron poller to launcher.



11
12
13
# File 'lib/sidekiq/cron/launcher.rb', line 11

def cron_poller
  @cron_poller
end

Instance Method Details

#initialize(config, **kwargs) ⇒ Object

Add cron poller and execute normal initialize of Sidekiq launcher.



14
15
16
17
18
19
# File 'lib/sidekiq/cron/launcher.rb', line 14

def initialize(config, **kwargs)
  config[:cron_poll_interval] = Sidekiq::Cron.configuration.cron_poll_interval.to_i

  @cron_poller = Sidekiq::Cron::Poller.new(config) if config[:cron_poll_interval] > 0
  super
end

#quietObject

Execute normal quiet of launcher and quiet cron poller.



28
29
30
31
# File 'lib/sidekiq/cron/launcher.rb', line 28

def quiet
  cron_poller.terminate if @cron_poller
  super
end

#runObject

Execute normal run of launcher and run cron poller.



22
23
24
25
# File 'lib/sidekiq/cron/launcher.rb', line 22

def run
  super
  cron_poller.start if @cron_poller
end

#stopObject

Execute normal stop of launcher and stop cron poller.



34
35
36
37
# File 'lib/sidekiq/cron/launcher.rb', line 34

def stop
  cron_poller.terminate if @cron_poller
  super
end