Sha256: 6352f9edbfe2280a03f00204efbfd0e0808a190b09c45c1929159a51c2fbc485
Contents?: true
Size: 580 Bytes
Versions: 49
Compression:
Stored size: 580 Bytes
Contents
module Katello class ApplicableHostQueue def self.batch_size ::Setting::Content.find_by(name: "applicability_batch_size").value end def self.queue_depth ::Katello::HostQueueElement.all.size end def self.push_host(host_id) HostQueueElement.create!({ host_id: host_id }) 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
49 entries across 49 versions & 1 rubygems