Skip to content

Commit

Permalink
Sleep some more time in ansible targeted refresh
Browse files Browse the repository at this point in the history
the sleep here is also needed because tower needs some time
to actually propagate it's updates
if we would return immediately it _could_ be that the we get
the old playbooks

the whole sleep business is a workaround anyway until we get
proper polling via ManageIQ/manageiq#14405


(transferred from ManageIQ/manageiq@85090c9)
  • Loading branch information
durandom committed Apr 26, 2017
1 parent d7de5bd commit 36fd8c6
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ def refresh_in_provider
log_header = "updating project #{project.id} (#{self.class.name} #{id})"
_log.info "#{log_header}..."
Timeout.timeout(5.minutes) do
while project_update.finished.blank?
sleep REFRESH_ON_TOWER_SLEEP
loop do
project_update = project_update.api.project_updates.find(project_update.id)
# the sleep here is also needed because tower needs some time to actually propagate it's updates
# if we would return immediately it _could_ be that the we get the old playbooks
# the whole sleep business is a workaround anyway until we get proper polling via the PR mentioned above
sleep REFRESH_ON_TOWER_SLEEP
break if project_update.finished.present?
end
end
_log.info "#{log_header}...Complete"
Expand Down

0 comments on commit 36fd8c6

Please sign in to comment.