Skip to content

Commit

Permalink
Merge pull request #21373 from iv1111/image_import_scheduler
Browse files Browse the repository at this point in the history
adding pvs <--pvc image import dispatcher to the schedule worker
  • Loading branch information
agrare committed Aug 16, 2021
2 parents c992dff + 636ad62 commit c83f5ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/models/miq_schedule_worker/jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ def infra_conversion_dispatcher_dispatch
end
end

def image_import_pvc_to_pvs_dispatcher_dispatch
if ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::ImageImportWorkflow::ImportDispatcher.waiting?
queue_work(:class_name => "ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::ImageImportWorkflow::ImportDispatcher", :method_name => "dispatch", :task_id => "job_dispatcher", :priority => MiqQueue::HIGH_PRIORITY)
end
end

def ems_refresh_timer(klass)
queue_work_on_each_zone(:class_name => klass.name, :method_name => "refresh_all_ems_timer") if klass.any?
end
Expand Down
6 changes: 6 additions & 0 deletions app/models/miq_schedule_worker/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ def schedules_for_scheduler_role
enqueue(:vm_scan_dispatcher_dispatch)
end

# Schedule - ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::ImageImportWorkflow::ImportDispatcher
# Queue a ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::ImageImportWorkflow::ImportDispatcher task unless there's already one on the queue
scheduler.schedule_every(:image_import_pvc_to_pvs_dispatcher_dispatch, worker_settings[:image_import_pvc_to_pvs_dispatcher_interval]) do
enqueue(:image_import_pvc_to_pvs_dispatcher_dispatch)
end

# Schedule - InfraConversionJob::Dispatcher
# Queue a InfraConversionJob::Dispatcher task unless there's already one on the queue
scheduler.schedule_every(:infra_conversion_dispatcher_dispatch, worker_settings[:infra_conversion_dispatcher_interval]) do
Expand Down
1 change: 1 addition & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,7 @@
:vim_performance_states_purge_interval: 1.day
:vm_retired_interval: 10.minutes
:vm_scan_dispatcher_interval: 15.seconds
:image_import_pvc_to_pvs_dispatcher_interval: 30.seconds
:vm_scan_dispatcher_stale_message_check_interval: 60.seconds
:vm_scan_dispatcher_stale_message_timeout: 2.minutes
:ui_worker:
Expand Down

0 comments on commit c83f5ae

Please sign in to comment.