Skip to content

Commit

Permalink
Merge pull request ManageIQ#23230 from Fryguy/more_frequent_wait
Browse files Browse the repository at this point in the history
Poll more frequently in Ansible::Runner::ResponseAsync#wait
  • Loading branch information
agrare authored Oct 13, 2024
2 parents 8f31201 + 467e1d5 commit 0d17c4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ansible/runner/response_async.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def dump
# @return [Ansible::Runner::Response] Response object with all details about the Ansible run
def wait(timeout)
result = nil
# Poll once per second until complete
1.upto(timeout) do |t|
# Poll every 0.1s until complete
(0.1..timeout).step(0.1) do
result = response
result ? break : sleep(1)
result ? break : sleep(0.1)
end
# If the process is still running, then stop it
if result.nil?
Expand Down

0 comments on commit 0d17c4d

Please sign in to comment.