From faf807cb869a0d5d587fa4a873e0b481f68e7ba5 Mon Sep 17 00:00:00 2001 From: Milarin Date: Thu, 22 Feb 2024 00:21:14 +0100 Subject: [PATCH] fixed missing loop in WaitUntilReachable --- check_reachable.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/check_reachable.go b/check_reachable.go index 4ccd021..1bde33b 100644 --- a/check_reachable.go +++ b/check_reachable.go @@ -24,14 +24,14 @@ func (c *Client) WaitUntilReachable(ctx context.Context) bool { ticker := time.NewTicker(100 * time.Millisecond) defer ticker.Stop() - select { - case <-ticker.C: - if c.IsReachable() { - return true + for { + select { + case <-ticker.C: + if c.IsReachable() { + return true + } + case <-ctx.Done(): + return false } - case <-ctx.Done(): - return false } - - return false }