Skip to content

Commit

Permalink
Merge pull request #18557 from jameswnl/jobtimeout
Browse files Browse the repository at this point in the history
update infra_migration_job when polling to prevent timing out
  • Loading branch information
roliveri authored Mar 18, 2019
2 parents d1b1883 + 29ec2d3 commit 084fd30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/infra_conversion_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def poll_conversion
unless migration_task.options.fetch_path(:virtv2v_wrapper, 'state_file')
message = "Virt v2v state file not available, continuing poll_conversion"
_log.info(prep_message(message))
update_attributes(:message => message)
return queue_signal(:poll_conversion, :deliver_on => Time.now.utc + options[:conversion_polling_interval])
end

Expand All @@ -99,6 +100,7 @@ def poll_conversion
v2v_status = migration_task.options[:virtv2v_status]
message = "virtv2v_status=#{v2v_status}"
_log.info(prep_message(message))
update_attributes(:message => message)

case v2v_status
when 'active'
Expand All @@ -120,6 +122,7 @@ def start_post_stage
# once we refactor Automate's PostTransformation into a job, we kick start it here
message = "To wait for Post-Transformation progress"
_log.info(prep_message(message))
update_attributes(:message => message)
queue_signal(:poll_post_stage, :deliver_on => Time.now.utc + options[:conversion_polling_interval])
end

Expand All @@ -128,6 +131,7 @@ def poll_post_stage

message = "PostTransformation state=#{migration_task.state}, status=#{migration_task.status}"
_log.info(prep_message(message))
update_attributes(:message => message)
if migration_task.state == 'finished'
self.status = migration_task.status
queue_signal(:finish)
Expand Down

0 comments on commit 084fd30

Please sign in to comment.