diff options
Diffstat (limited to 'core/utils.go')
-rw-r--r-- | core/utils.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/utils.go b/core/utils.go index f7dee75..5742d11 100644 --- a/core/utils.go +++ b/core/utils.go @@ -236,14 +236,14 @@ func checkWithCancel(parentCtx context.Context, interval time.Duration, defer cancel() Loop: for { + if ret = checker(); ret { + return + } select { case <-ctx.Done(): break Loop case <-time.After(interval): } - if ret = checker(); ret { - return - } } return } |