Skip to content

Commit

Permalink
Merge pull request #23151 from agrare/start_automation_runners_in_aut…
Browse files Browse the repository at this point in the history
…omation_worker

Start all automation runners in AutomationWorker
  • Loading branch information
Fryguy authored Aug 15, 2024
2 parents c2ac7d7 + 59bcade commit 9343b8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/models/automation_worker/runner.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
class AutomationWorker::Runner < MiqQueueWorkerBase::Runner
def do_before_work_loop
super
@automation_runners = Vmdb::Plugins.automation_runner_classes.map(&:runner)
end

def before_exit(*)
super
@automation_runners.each(&:stop)
end
end
4 changes: 4 additions & 0 deletions lib/vmdb/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def automate_domains
end
end

def automation_runner_classes
@automation_runner_classes ||= flat_map { |engine| engine.try(:automation_runners) }.compact
end

def miq_widgets_content
@miq_widgets_content ||= Rails.root.join("product/dashboard/widgets").glob("*").map(&:to_s) + flat_map { |engine| content_directories(engine, "dashboard/widgets") }
end
Expand Down

0 comments on commit 9343b8b

Please sign in to comment.