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

Run MiqServer.status_update in server process #20904

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
2 changes: 1 addition & 1 deletion app/models/miq_schedule_worker/jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def vmdb_appliance_log_config
end

def miq_server_status_update
queue_work(:class_name => "MiqServer", :method_name => "status_update", :server_guid => MiqServer.my_guid, :priority => MiqQueue::HIGH_PRIORITY)
queue_work(:class_name => "MiqServer", :method_name => "status_update", :queue_name => 'miq_server', :server_guid => MiqServer.my_guid, :priority => MiqQueue::HIGH_PRIORITY)
end

def miq_server_worker_log_status
Expand Down
13 changes: 13 additions & 0 deletions spec/models/miq_schedule_worker/jobs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,17 @@
)
end
end

context "with guid, server, zone" do
let!(:guid_server_zone) { EvmSpecHelper.create_guid_miq_server_zone }
let(:guid) { guid_server_zone.first }
let(:zone) { guid_server_zone.last }

context "queues for miq_server process" do
it "#miq_server_status_update" do
described_class.new.miq_server_status_update
expect(MiqQueue.where(:method_name => "status_update").first).to have_attributes(:queue_name => "miq_server", :server_guid => guid, :zone => zone.name)
end
end
end
end