From 9d197a91e10671bcd1a70a8e20a3ff2e1cb5deef Mon Sep 17 00:00:00 2001 From: Chris Kinsman Date: Wed, 16 Dec 2015 16:43:22 -0800 Subject: [PATCH] Add resume --- copy-to.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/copy-to.js b/copy-to.js index f70effd..da10d03 100644 --- a/copy-to.js +++ b/copy-to.js @@ -19,6 +19,7 @@ var eventTypes = ['close', 'data', 'end', 'error'] CopyStreamQuery.prototype.submit = function(connection) { connection.query(this.text) this.connection = connection + this.connection.removeAllListeners('copyData') connection.stream.pipe(this) } @@ -31,6 +32,8 @@ var code = { CopyStreamQuery.prototype._detach = function() { this.connection.stream.unpipe(this) + // Unpipe can drop us out of flowing mode + this.connection.stream.resume() }