copy from: removing copyFromStream dependency

This commit is contained in:
Simon Martín 2018-06-21 14:38:22 +02:00
parent 01eff0a5a2
commit 9970052e1b
2 changed files with 3 additions and 3 deletions

View File

@ -109,7 +109,7 @@ function handleCopyFrom (logger) {
const metrics = new StreamCopyMetrics(logger, 'copyfrom', sql, user, isGzip); const metrics = new StreamCopyMetrics(logger, 'copyfrom', sql, user, isGzip);
streamCopy.from( streamCopy.from(
function (err, pgstream, copyFromStream) { function (err, pgstream) {
if (err) { if (err) {
return next(err); return next(err);
} }
@ -139,7 +139,7 @@ function handleCopyFrom (logger) {
return next(err); return next(err);
}) })
.on('end', () => { .on('end', () => {
metrics.end(copyFromStream.rowCount); metrics.end( streamCopy.getRowCount(StreamCopy.ACTION_FROM) );
const { time, rows } = metrics; const { time, rows } = metrics;

View File

@ -65,7 +65,7 @@ module.exports = class StreamCopy {
client.connection.sendCopyFail('CARTO SQL API: Connection closed by client'); client.connection.sendCopyFail('CARTO SQL API: Connection closed by client');
}); });
cb(null, pgstream, copyFromStream); cb(null, pgstream);
}); });
} }