Skip to content

Commit

Permalink
honor storage_file_collection_time_utc setting
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandtWoolf committed Mar 22, 2019
1 parent 99e4014 commit 3ebe5d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/models/miq_schedule_worker/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ def schedules_for_scheduler_role

# 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
time_at = 1.day.from_now.utc.strftime("%Y-%m-%d #{at}").to_time(:utc)
else
time_at = Time.now.strftime("%Y-%m-%d #{at}").to_time(:utc)
end
time_at = if Time.zone.today.to_time(:utc) + at.seconds < Time.now.utc
Time.zone.today.to_time(:utc) + at.seconds + 1.day
else
Time.zone.today.to_time(:utc) + at.seconds
end
scheduler.schedule_every(
worker_settings[:storage_file_collection_interval],
:first_at => time_at
Expand Down

0 comments on commit 3ebe5d4

Please sign in to comment.