fixed missing loop in WaitUntilReachable

This commit is contained in:
Milarin 2024-02-22 00:21:14 +01:00
parent 075a8441cd
commit faf807cb86

View File

@ -24,14 +24,14 @@ func (c *Client) WaitUntilReachable(ctx context.Context) bool {
ticker := time.NewTicker(100 * time.Millisecond) ticker := time.NewTicker(100 * time.Millisecond)
defer ticker.Stop() defer ticker.Stop()
select { for {
case <-ticker.C: select {
if c.IsReachable() { case <-ticker.C:
return true if c.IsReachable() {
return true
}
case <-ctx.Done():
return false
} }
case <-ctx.Done():
return false
} }
return false
} }