Removing unpipe calls, regarding documentation, unpipe is emitted when error.

This commit is contained in:
Daniel García Aubert 2019-05-27 15:26:44 +02:00
parent c0b5997745
commit 73eb9656cd

View File

@ -86,7 +86,6 @@ function handleCopyTo (logger) {
.on('data', data => metrics.addSize(data.length)) .on('data', data => metrics.addSize(data.length))
.on('error', err => { .on('error', err => {
metrics.end(null, err); metrics.end(null, err);
pgstream.unpipe(res);
return next(err); return next(err);
}) })
@ -154,8 +153,6 @@ function handleCopyFrom (logger) {
.pipe(pgstream) .pipe(pgstream)
.on('error', err => { .on('error', err => {
metrics.end(null, err); metrics.end(null, err);
req.unpipe(decompress);
decompress.unpipe(pgstream);
return next(err); return next(err);
}) })