Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start all automation runners in AutomationWorker #23151

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading