copy from: removing copyFromStream dependency
This commit is contained in:
parent
01eff0a5a2
commit
9970052e1b
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user