-
Notifications
You must be signed in to change notification settings - Fork 900
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
Make spawn pass worker options again #16199
Changes from all commits
26b5ac9
7a20aa2
14d4226
7cc854e
8e013be
1c75bc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,8 +43,6 @@ def self.interrupt_signals | |
|
||
def initialize(cfg = {}) | ||
@cfg = cfg | ||
@cfg[:guid] ||= ENV['MIQ_GUID'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
$log ||= Rails.logger | ||
|
||
@server = MiqServer.my_server(true) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,7 +133,6 @@ def rails_application | |
|
||
def start | ||
delete_pid_file | ||
ENV['MIQ_GUID'] = guid | ||
super | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,10 @@ | |
options[:guid] = val | ||
end | ||
|
||
opts.on("-e=ems_id", "--ems-id=ems_id,ems_id", Array, "Provide a list of ems ids (without spaces) to a provider worker. This requires, at least one argument.") do |val| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could probably be explained better, and formatted better. |
||
options[:ems_id] = val | ||
end | ||
|
||
opts.on("-h", "--help", "Displays this help") do | ||
puts opts | ||
exit | ||
|
@@ -60,9 +64,9 @@ | |
create_options = {:pid => Process.pid} | ||
runner_options = {} | ||
|
||
if ENV["QUEUE"] | ||
create_options[:queue_name] = ENV["QUEUE"] | ||
runner_options[:ems_id] = worker_class.ems_id_from_queue_name(ENV["QUEUE"]) if worker_class.respond_to?(:ems_id_from_queue_name) | ||
if options[:ems_id] | ||
create_options[:queue_name] = options[:ems_id].length == 1 ? "ems_#{options[:ems_id].first}" : options[:ems_id].collect { |id| "ems_#{id}" } | ||
runner_options[:ems_id] = options[:ems_id].length == 1 ? options[:ems_id].first : options[:ems_id].collect { |id| id } | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really don't like how I did this. The problem is, Any suggestions to make it look nicer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's try to find a better way to do it. I can't think of one right now. Your changes are great for now. We can clean this up when we find a better place for this logic. |
||
|
||
worker = if options[:guid] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is for @carbonin 🎁