Sha256: 4113d22083ff20b54a999138b86a941978753ad50de77060df073e14810ec9e0

Contents?: true

Size: 512 Bytes

Versions: 26

Compression:

Stored size: 512 Bytes

Contents

module Workarea
  module QueuesPauser
    extend self

    def pause_queues!
      pauser = Sidekiq::Throttled::QueuesPauser.instance
      queues.each { |queue| pauser.pause!(queue) }
    end

    def resume_queues!
      pauser = Sidekiq::Throttled::QueuesPauser.instance
      queues.each { |queue| pauser.resume!(queue) }
    end

    def with_paused_queues(&block)
      pause_queues!
      yield
    ensure
      resume_queues!
    end

    def queues
      Configuration::Sidekiq.queues
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
workarea-core-3.5.15 lib/workarea/queues_pauser.rb
workarea-core-3.4.36 lib/workarea/queues_pauser.rb
workarea-core-3.5.14 lib/workarea/queues_pauser.rb
workarea-core-3.4.35 lib/workarea/queues_pauser.rb
workarea-core-3.5.13 lib/workarea/queues_pauser.rb
workarea-core-3.4.34 lib/workarea/queues_pauser.rb