lib/sidekiq/batching/actor.rb in sidekiq-batching-0.0.2 vs lib/sidekiq/batching/actor.rb in sidekiq-batching-0.0.3
- old
+ new
@@ -4,11 +4,10 @@
include Sidekiq::Batching::Logging
include Celluloid
def initialize
link_to_sidekiq_manager
- start_polling
end
private
def start_polling
interval = Sidekiq::Batching::Config.poll_interval
@@ -28,9 +27,10 @@
flush(batches)
end
def link_to_sidekiq_manager
Sidekiq::CLI.instance.launcher.manager.link(current_actor)
+ start_polling
rescue NoMethodError
debug "Can't link #{self.class.name}. Sidekiq::Manager not running. Retrying in 5 seconds ..."
after(5) { link_to_sidekiq_manager }
end
\ No newline at end of file