check reachability once at method call
This commit is contained in:
parent
5e1ba06ebe
commit
13a1346c39
@ -21,6 +21,10 @@ func (c *Client) IsReachable() bool {
|
|||||||
// and returns true as soon as IsReachable returns true.
|
// and returns true as soon as IsReachable returns true.
|
||||||
// When ctx is closed before Hyprland is reachable, false is returned
|
// When ctx is closed before Hyprland is reachable, false is returned
|
||||||
func (c *Client) WaitUntilReachable(ctx context.Context) bool {
|
func (c *Client) WaitUntilReachable(ctx context.Context) bool {
|
||||||
|
if c.IsReachable() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
ticker := time.NewTicker(100 * time.Millisecond)
|
ticker := time.NewTicker(100 * time.Millisecond)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user