send CopyFail when user close connection
This commit is contained in:
parent
a083eb909c
commit
310f652ae4
@ -61,8 +61,9 @@ module.exports = {
|
|||||||
})
|
})
|
||||||
.on('close', () => {
|
.on('close', () => {
|
||||||
if (!requestEnded) {
|
if (!requestEnded) {
|
||||||
|
const connection = client.connection;
|
||||||
|
connection.sendCopyFail();
|
||||||
req.unpipe(pgstream);
|
req.unpipe(pgstream);
|
||||||
pgstream.end();
|
|
||||||
return cb(new Error('Connection closed by client'));
|
return cb(new Error('Connection closed by client'));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user