diff --git a/lib/connection.js b/lib/connection.js index f8578176..3d8888f1 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -149,7 +149,10 @@ function Connection(options = {}) { : (messages.push(buffer), connect()) } catch (err) { query.reject(err) - idle() + } + finally { + clearTimeout(timer) + timer = setTimeout(socket.end, idle_timeout * 1000) } }