From 06c9db74310008743988a9a8773b08689a728009 Mon Sep 17 00:00:00 2001 From: Jonathon Turel Date: Fri, 19 Dec 2025 00:20:07 +0000 Subject: [PATCH] Does this event need to be retryable? --- .../katello/applicability/hosts/bulk_generate.rb | 4 ---- .../katello/events/generate_host_applicability.rb | 15 +++------------ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/app/lib/actions/katello/applicability/hosts/bulk_generate.rb b/app/lib/actions/katello/applicability/hosts/bulk_generate.rb index b90dcc39c99..1cb758ae997 100644 --- a/app/lib/actions/katello/applicability/hosts/bulk_generate.rb +++ b/app/lib/actions/katello/applicability/hosts/bulk_generate.rb @@ -32,10 +32,6 @@ def queue ::Katello::HOST_TASKS_QUEUE end - def resource_locks - :link - end - def hostname(host_id) content_facet = ::Katello::Host::ContentFacet.find_by_host_id(host_id) content_facet&.host&.name diff --git a/app/models/katello/events/generate_host_applicability.rb b/app/models/katello/events/generate_host_applicability.rb index 810b1c06bd6..2751aaea902 100644 --- a/app/models/katello/events/generate_host_applicability.rb +++ b/app/models/katello/events/generate_host_applicability.rb @@ -3,24 +3,15 @@ module Events class GenerateHostApplicability EVENT_TYPE = 'generate_host_applicability'.freeze - def self.retry_seconds - 180 - end - def initialize(object_id) end def run return if ::Katello::ApplicableHostQueue.queue_depth == 0 - begin - while ::Katello::ApplicableHostQueue.queue_depth != 0 - hosts = ::Katello::ApplicableHostQueue.pop_hosts - ForemanTasks.async_task(::Actions::Katello::Applicability::Hosts::BulkGenerate, host_ids: hosts.map(&:host_id)) - end - rescue => e - self.retry = true if e.is_a?(ForemanTasks::Lock::LockConflict) - raise e + while ::Katello::ApplicableHostQueue.queue_depth != 0 + hosts = ::Katello::ApplicableHostQueue.pop_hosts + ForemanTasks.async_task(::Actions::Katello::Applicability::Hosts::BulkGenerate, host_ids: hosts.map(&:host_id)) end end end