Preventing callbacks from accidentally being called twice
This commit is contained in:
parent
270daae579
commit
7d1a0abadd
@ -15,7 +15,7 @@ module.exports = class StreamCopy extends EventEmitter {
|
||||
to(cb) {
|
||||
this.pg.connect((err, client, done) => {
|
||||
if (err) {
|
||||
cb(err);
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
const copyToStream = copyTo(this.sql);
|
||||
@ -40,7 +40,7 @@ module.exports = class StreamCopy extends EventEmitter {
|
||||
from(cb) {
|
||||
this.pg.connect((err, client, done) => {
|
||||
if (err) {
|
||||
cb(err);
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
const copyFromStream = copyFrom(this.sql);
|
||||
|
Loading…
Reference in New Issue
Block a user