Skip to content

Commit c2eac60

Browse files
committed
Refs #38856 - rubocop + unneeded rescue
1 parent 3783dc7 commit c2eac60

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

app/services/katello/content_view_manager.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,24 @@ def self.scheduled_composite_publish?(composite_cv)
9696
.for_action(::Actions::Katello::ContentView::Publish)
9797
.where(state: 'scheduled')
9898
.any? do |task|
99-
begin
100-
delayed_plan = ForemanTasks.dynflow.world.persistence.load_delayed_plan(task.external_id)
101-
args = delayed_plan.args
102-
args.first.is_a?(::Katello::ContentView) && args.first.id == composite_cv.id
103-
rescue StandardError
104-
false
105-
end
99+
delayed_plan = ForemanTasks.dynflow.world.persistence.load_delayed_plan(task.external_id)
100+
args = delayed_plan.args
101+
args.first.is_a?(::Katello::ContentView) && args.first.id == composite_cv.id
106102
end
107103
end
108104

109105
def self.running_component_publish_task_ids(composite_cv)
110106
component_cv_ids = composite_cv.components.pluck(:content_view_id)
111107
return [] if component_cv_ids.empty?
112108

113-
ForemanTasks::Task::DynflowTask
109+
tasks = ForemanTasks::Task::DynflowTask
114110
.for_action(::Actions::Katello::ContentView::Publish)
115111
.where(state: ['planning', 'planned', 'running'])
116112
.select do |task|
117113
task_input = task.input
118114
task_input && component_cv_ids.include?(task_input.dig('content_view', 'id'))
119115
end
120-
.map(&:external_id)
116+
tasks.map(&:external_id)
121117
end
122118
end
123119
end

0 commit comments

Comments
 (0)