diff --git a/v2/client.go b/v2/client.go index 7c38366..ca21f19 100644 --- a/v2/client.go +++ b/v2/client.go @@ -155,10 +155,12 @@ func (c *Client) IsReady() bool { default: } - ready := c.mux.TryLock() - defer c.mux.Unlock() + if c.mux.TryLock() { + c.mux.Unlock() + return true + } - return ready + return false } func (c *Client) fatal(err error) {