Skip to content

Commit

Permalink
format time interval for log message to look like '10 minutes' instea…
Browse files Browse the repository at this point in the history
  • Loading branch information
yrudman committed Jun 16, 2017
1 parent dfc0146 commit 2f71cb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/miq_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MiqTask < ApplicationRecord
def self.update_status_for_timed_out_active_tasks
MiqTask.active.timed_out.no_associated_job.find_each do |task|
task.update_status(STATE_FINISHED, STATUS_ERROR,
"Task [#{task.id}] timed out - not active for more than #{::Settings.task.active_task_timeout}")
"Task [#{task.id}] timed out - not active for more than #{::Settings.task.active_task_timeout.to_i_with_method} seconds")
end
end

Expand Down
1 change: 1 addition & 0 deletions spec/models/miq_task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@
MiqTask.update_status_for_timed_out_active_tasks
miq_task.reload
expect(miq_task.status).to eq MiqTask::STATUS_ERROR
expect(miq_task.message).to include("not active for more than 3600 seconds")
end

it "does not update status if task not timed out" do
Expand Down

0 comments on commit 2f71cb4

Please sign in to comment.