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

Version Path
katello-4.0.3 app/services/katello/applicable_host_queue.rb
katello-3.18.5 app/services/katello/applicable_host_queue.rb
katello-4.0.2.1 app/services/katello/applicable_host_queue.rb
katello-4.0.2 app/services/katello/applicable_host_queue.rb
katello-3.18.4 app/services/katello/applicable_host_queue.rb
katello-4.0.1.2 app/services/katello/applicable_host_queue.rb
katello-3.18.3.1 app/services/katello/applicable_host_queue.rb
katello-4.1.0.rc2.2 app/services/katello/applicable_host_queue.rb
katello-4.1.0.rc2.1 app/services/katello/applicable_host_queue.rb
katello-4.0.1.1 app/services/katello/applicable_host_queue.rb
katello-3.18.3 app/services/katello/applicable_host_queue.rb
katello-4.1.0.rc2 app/services/katello/applicable_host_queue.rb
katello-4.0.1 app/services/katello/applicable_host_queue.rb
katello-4.1.0.rc1.1 app/services/katello/applicable_host_queue.rb
katello-4.1.0.rc1 app/services/katello/applicable_host_queue.rb
katello-4.0.0 app/services/katello/applicable_host_queue.rb
katello-4.0.0.rc3.1 app/services/katello/applicable_host_queue.rb
katello-4.0.0.rc3 app/services/katello/applicable_host_queue.rb
katello-3.18.2.1 app/services/katello/applicable_host_queue.rb
katello-3.18.2 app/services/katello/applicable_host_queue.rb