Sha256: 4cd5d8a66d3dc53438f3e17bea8e6b99d7fbb5049eb62ab643531294ca6078f6

Contents?: true

Size: 583 Bytes

Versions: 56

Compression:

Stored size: 583 Bytes

Contents

module Katello
  class ApplicableHostQueue
    def self.batch_size
      Setting["applicability_batch_size"]
    end

    def self.queue_depth
      ::Katello::HostQueueElement.all.size
    end

    def self.push_hosts(ids)
      HostQueueElement.import ids.map { |host_id| { host_id: host_id } }, validate: false
    end

    def self.pop_hosts(amount = self.batch_size)
      queue = HostQueueElement.group(:host_id).select("MIN(created_at) as created_at, host_id").limit(amount)
      HostQueueElement.where(host_id: queue.map(&:host_id)).delete_all
      queue
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
katello-4.7.3 app/services/katello/applicable_host_queue.rb
katello-4.7.2 app/services/katello/applicable_host_queue.rb
katello-4.7.1 app/services/katello/applicable_host_queue.rb
katello-4.6.2.1 app/services/katello/applicable_host_queue.rb
katello-4.6.2 app/services/katello/applicable_host_queue.rb
katello-4.7.0 app/services/katello/applicable_host_queue.rb
katello-4.6.1 app/services/katello/applicable_host_queue.rb
katello-4.7.0.rc2 app/services/katello/applicable_host_queue.rb
katello-4.7.0.rc1 app/services/katello/applicable_host_queue.rb
katello-4.5.1 app/services/katello/applicable_host_queue.rb
katello-4.6.0 app/services/katello/applicable_host_queue.rb
katello-4.6.0.rc2 app/services/katello/applicable_host_queue.rb
katello-4.6.0.rc1 app/services/katello/applicable_host_queue.rb
katello-4.5.0 app/services/katello/applicable_host_queue.rb
katello-4.5.0.rc2 app/services/katello/applicable_host_queue.rb
katello-4.5.0.rc1 app/services/katello/applicable_host_queue.rb