Skip to content

Commit 4e6606b

Browse files
committed
retry: Sleep after failure
This way if the condition is true in the first iteration we exit immediately. Signed-off-by: Jeremi Piotrowski <[email protected]>
1 parent 50a8822 commit 4e6606b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util/retry.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ func WaitUntilReady(timeout, delay time.Duration, checkFunction func() (bool, er
5757
default:
5858
}
5959

60-
time.Sleep(delay)
61-
6260
done, err := checkFunction()
6361
if err != nil {
6462
return err
@@ -67,6 +65,8 @@ func WaitUntilReady(timeout, delay time.Duration, checkFunction func() (bool, er
6765
if done {
6866
break
6967
}
68+
69+
time.Sleep(delay)
7070
}
7171
return nil
7272
}

0 commit comments

Comments
 (0)