Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update infra_migration_job when polling to prevent timing out #18557

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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