Skip to content

Commit

Permalink
try to resume paused tasks while cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Oct 1, 2018
1 parent 92095bd commit c1e1d87
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cvmanager
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ end

def wait(tasks)
need_wait = tasks
resumed_tasks = []
if @options[:wait]
last_need_wait = []
silence = false
Expand All @@ -517,6 +518,11 @@ def wait(tasks)
if req['pending']
need_wait << task_id
end
if req['state'] == 'paused' and not resumed_tasks.include?(task_id)
puts "Resuming paused task #{task_id}"
@api.resource(:foreman_tasks).call(:bulk_resume, {:task_ids => [task_id]})
resumed_tasks << task_id
end
end
if (wait_secs >= 60 and (last_need_wait.sort == need_wait.sort))
puts "Silencing output until there's a task status change..." unless silence
Expand Down

0 comments on commit c1e1d87

Please sign in to comment.