Sha256: e7232e62eb4786f29d9b5478313b072f1653d6d7387311151436678cfbe364d5

Contents?: true

Size: 505 Bytes

Versions: 4

Compression:

Stored size: 505 Bytes

Contents

class Sidekiq::Grouping::Flusher
  def flush
    batches = Sidekiq::Grouping::Batch.all.map do |batch|
      batch if batch.could_flush?
    end
    batches.compact!
    flush_concrete(batches)
  end

  private

  def flush_concrete(batches)
    return if batches.empty?
    names = batches.map { |batch| "#{batch.worker_class} in #{batch.queue}" }
    Sidekiq::Grouping.logger.info(
      "[Sidekiq::Grouping] Trying to flush batched queues: #{names.join(',')}"
    )
    batches.each(&:flush)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sidekiq-grouping-1.0.9 lib/sidekiq/grouping/flusher.rb
sidekiq-grouping-1.0.8 lib/sidekiq/grouping/flusher.rb
sidekiq-grouping-1.0.7 lib/sidekiq/grouping/flusher.rb
sidekiq-grouping-1.0.6 lib/sidekiq/grouping/flusher.rb