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