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.27 lib/workarea/queues_pauser.rb
workarea-core-3.5.26 lib/workarea/queues_pauser.rb
workarea-core-3.4.45 lib/workarea/queues_pauser.rb
workarea-core-3.5.25 lib/workarea/queues_pauser.rb
workarea-core-3.5.23 lib/workarea/queues_pauser.rb
workarea-core-3.4.44 lib/workarea/queues_pauser.rb
workarea-core-3.5.22 lib/workarea/queues_pauser.rb
workarea-core-3.4.43 lib/workarea/queues_pauser.rb
workarea-core-3.5.21 lib/workarea/queues_pauser.rb
workarea-core-3.4.42 lib/workarea/queues_pauser.rb
workarea-core-3.5.20 lib/workarea/queues_pauser.rb
workarea-core-3.4.41 lib/workarea/queues_pauser.rb
workarea-core-3.5.19 lib/workarea/queues_pauser.rb
workarea-core-3.4.40 lib/workarea/queues_pauser.rb
workarea-core-3.5.18 lib/workarea/queues_pauser.rb
workarea-core-3.4.39 lib/workarea/queues_pauser.rb
workarea-core-3.5.17 lib/workarea/queues_pauser.rb
workarea-core-3.4.38 lib/workarea/queues_pauser.rb
workarea-core-3.5.16 lib/workarea/queues_pauser.rb
workarea-core-3.4.37 lib/workarea/queues_pauser.rb