From bf498197cbd6de161d20722c05f06995a936179b Mon Sep 17 00:00:00 2001 From: Martin Garton Date: Wed, 28 Sep 2016 20:27:32 +0100 Subject: [PATCH] Allow timeout to complete When the timeout it reached, the query can still fail to complete if the caller isn't consuming the results from the channel. This change allows the query to exit in any case. --- client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client.go b/client.go index 24c1450..f4f0af0 100644 --- a/client.go +++ b/client.go @@ -335,6 +335,8 @@ func (c *client) query(params *QueryParam) error { inp.sent = true select { case params.Entries <- inp: + case <-finish: + return nil } } else { // Fire off a node specific query