Sha256: e7932ba31633d28fec67b4ccd3d9abb302bc200bbebb318ee6e95c126aaa76b2

Contents?: true

Size: 505 Bytes

Versions: 15

Compression:

Stored size: 505 Bytes

Contents

module Katello
  module Resources
    module Candlepin
      class Admin < CandlepinResource
        extend AdminResource

        def self.queues
          response = get("#{path}/queues")
          JSON.parse(response.body).first
        end

        def self.queue_depth(queue_name)
          queue = queues.select { |q| q['queueName'] == queue_name }
          queue['pendingMessageCount'].to_i
        rescue
          nil # be graceful when candlepin is down
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
katello-3.15.3.1 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.3 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.2 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.1.1 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.1 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.0.1 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.0 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.0.rc2 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.0.rc1.3 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.0.rc1.2 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.0.rc1.1 app/lib/katello/resources/candlepin/admin.rb
katello-3.15.0.rc1 app/lib/katello/resources/candlepin/admin.rb
katello-3.14.1 app/lib/katello/resources/candlepin/admin.rb
katello-3.14.0 app/lib/katello/resources/candlepin/admin.rb
katello-3.14.0.rc2 app/lib/katello/resources/candlepin/admin.rb