Sha256: 373f94a9a7a5e9ae655322ceb038f7e5a462b6eabdcf740e51e71010c0fc5b43

Contents?: true

Size: 496 Bytes

Versions: 1

Compression:

Stored size: 496 Bytes

Contents

require 'sidekiq/api'

# This initializer inspects the currently scheduled Sidekiq workers,
# of which the Sidekiq::Snitch must always be one in a properly
# configured application.
#
# When none are found, schedule one to run immediately. The worker
# will then take care of rescheduling itself.
set = Sidekiq::ScheduledSet.new
already_scheduled = set.any? {|job| job.klass == "Sidekiq::Snitch" }

if ! already_scheduled && ! ENV['SIDEKIQ_SNITCH_URL'].blank?
  Sidekiq::Snitch.perform_async
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sidekiq_snitch-1.2.0 config/initializers/perform.rb