Skip to content

Commit

Permalink
Add purge schedule for VimPerformanceState
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonin committed Jan 5, 2018
1 parent 7b6e63c commit 85f480c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/miq_schedule_worker/jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def binary_blob_purge_timer
queue_work(:class_name => "BinaryBlob", :method_name => "purge_timer", :zone => nil)
end

def vim_performance_states_purge_timer
queue_work(:class_name => "VimPerformanceState", :method_name => "purge_timer", :zone => nil)
end

def miq_schedule_queue_scheduled_work(schedule_id, rufus_job)
MiqSchedule.queue_scheduled_work(schedule_id, rufus_job.job_id, rufus_job.next_time.to_i, rufus_job.opts)
end
Expand Down
5 changes: 5 additions & 0 deletions app/models/miq_schedule_worker/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ def schedules_for_scheduler_role
enqueue(:binary_blob_purge_timer)
end

every = worker_settings[:vim_performance_states_purge_interval]
scheduler.schedule_every(every, :first_in => every) do
enqueue(:vim_performance_states_purge_timer)
end

# Schedule every 24 hours
at = worker_settings[:storage_file_collection_time_utc]
if Time.now.strftime("%Y-%m-%d #{at}").to_time(:utc) < Time.now.utc
Expand Down
1 change: 1 addition & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,7 @@
:storage_file_collection_interval: 1.days
:storage_file_collection_time_utc: 21600
:task_timeout_check_frequency: 1.hour
:vim_performance_states_purge_interval: 1.day
:vm_retired_interval: 10.minutes
:yum_update_check: 12.hours
:ui_worker:
Expand Down

0 comments on commit 85f480c

Please sign in to comment.