Improve the condition check.
This commit is contained in:
parent
a7cd859919
commit
85f7c944c2
|
|
@ -37,12 +37,7 @@ func TestRetryWorkerOneFalse(t *testing.T) {
|
||||||
tick := &mockTicker{t, 0}
|
tick := &mockTicker{t, 0}
|
||||||
result := RetryWorker(1, 3, tick, func() (bool, error) {
|
result := RetryWorker(1, 3, tick, func() (bool, error) {
|
||||||
counter++
|
counter++
|
||||||
|
return counter > 1, nil
|
||||||
if counter <= 1 {
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return true, nil
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if result != nil {
|
if result != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue