Skip to content

Commit

Permalink
Introduce report result purging timer
Browse files Browse the repository at this point in the history
The resources required for report result purging has been reduced,
so make sure this is scheduled.

https://bugzilla.redhat.com/show_bug.cgi?id=1348625
  • Loading branch information
kbrock committed Dec 14, 2016
1 parent 6ff1811 commit 2f78249
Show file tree
Hide file tree
Showing 3 changed files with 11 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 @@ -117,6 +117,10 @@ def policy_event_purge_timer
queue_work(:class_name => "PolicyEvent", :method_name => "purge_timer", :zone => nil)
end

def miq_report_result_purge_timer
queue_work(:class_name => "MiqReportResult", :method_name => "purge_timer", :zone => nil)
end

def storage_refresh_metrics
queue_work(
:class_name => "StorageManager",
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 @@ -215,6 +215,12 @@ def schedules_for_scheduler_role
enqueue :miq_alert_evaluate_hourly_timer
end

# Schedule - Prune old reports Timer
every = worker_settings[:report_result_purge_interval]
scheduler.schedule_every(every, :first_in => every) do
enqueue :miq_report_result_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 @@ -1393,6 +1393,7 @@
:policy_events_purge_interval: 1.day
:poll: 15.seconds
:resync_rhn_mirror: 12.hours
:report_result_purge_interval: 1.week
:server_log_stats_interval: 5.minutes
:server_stats_interval: 60.seconds
:service_retired_interval: 10.minutes
Expand Down

0 comments on commit 2f78249

Please sign in to comment.