Skip to content

Commit

Permalink
Start all automation runners in AutomationWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Aug 15, 2024
1 parent 69ac930 commit 59bcade
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 @@ -95,6 +95,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 ||= Dir.glob(Rails.root.join("product/dashboard/widgets/*")) + flat_map { |engine| content_directories(engine, "dashboard/widgets") }
end
Expand Down

0 comments on commit 59bcade

Please sign in to comment.