Sha256: 953406878b17b1f1a4d210943d255e1cec0304d0cbce77d392979e814711c3d3
Contents?: true
Size: 731 Bytes
Versions: 59
Compression:
Stored size: 731 Bytes
Contents
=begin require "sidekiq/api" module Auth module SidekiqUp ## @param job_description[String]: a json representation of whatever job / arguments you wanted to pass into sidekiq, it is used to log an error in case sidekiq is down. ## the determination of sidekiq begin down is done by checking if the queues hash is empty. ## @return : yields the block called with this method in case the queues are not empty, otherwise the result of calling Rails.logger.error def self.sidekiq_running(job_description) stats = Sidekiq::Stats.new yield #yield unless stats.queues.empty? #Rails.logger.error("sidekiq could not do job because sidekiq was not started: #{job_description}") if stats.queues.empty? end end end =end
Version data entries
59 entries across 59 versions & 1 rubygems