Sha256: 9d98e7a926ebc6dcc14848591761747d4daf319eb5f2cbc7a10e8ff381230fd8
Contents?: true
Size: 614 Bytes
Versions: 29
Compression:
Stored size: 614 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_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
29 entries across 29 versions & 1 rubygems