Do not resume internal connection stream (handled properly in the pg-copy-stream module)
This commit is contained in:
parent
e57f7b6ecf
commit
19b9aab042
@ -46,17 +46,14 @@ module.exports = class StreamCopy {
|
||||
|
||||
this.clientProcessID = client.processID;
|
||||
|
||||
const streamMaker = action === ACTION_TO ? copyTo : copyFrom;
|
||||
this.stream = streamMaker(this.sql);
|
||||
this.stream = action === ACTION_TO ? copyTo(this.sql) : copyFrom(this.sql);
|
||||
|
||||
const pgstream = client.query(this.stream);
|
||||
|
||||
if (action === ACTION_TO) {
|
||||
pgstream.on('end', () => {
|
||||
pgstream.connection.stream.resume();
|
||||
done();
|
||||
});
|
||||
pgstream.on('end', () => done());
|
||||
} else if (action === ACTION_FROM) {
|
||||
pgstream.on('finish', () => done())
|
||||
pgstream.on('finish', () => done());
|
||||
}
|
||||
|
||||
pgstream.on('error', err => done(err));
|
||||
|
Loading…
Reference in New Issue
Block a user