Make the SET statement_timeout async
This commit is contained in:
parent
fdab0136e6
commit
cc348f3725
@ -33,7 +33,11 @@ module.exports = class StreamCopy {
|
|||||||
return cb(err);
|
return cb(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
client.query('SET statement_timeout=' + this.timeout);
|
client.query('SET statement_timeout=' + this.timeout, (err) => {
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
return cb(err);
|
||||||
|
}
|
||||||
|
|
||||||
let streamMaker = action === ACTION_TO ? copyTo : copyFrom;
|
let streamMaker = action === ACTION_TO ? copyTo : copyFrom;
|
||||||
this.stream = streamMaker(this.sql);
|
this.stream = streamMaker(this.sql);
|
||||||
@ -57,6 +61,7 @@ module.exports = class StreamCopy {
|
|||||||
|
|
||||||
cb(null, pgstream);
|
cb(null, pgstream);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getRowCount() {
|
getRowCount() {
|
||||||
|
Loading…
Reference in New Issue
Block a user