log metrics only once
This commit is contained in:
parent
550c736032
commit
dd689d3568
@ -16,6 +16,8 @@ module.exports = class StreamCopyMetrics {
|
||||
this.time = null;
|
||||
|
||||
this.error = null;
|
||||
|
||||
this.ended = false;
|
||||
}
|
||||
|
||||
addSize(size) {
|
||||
@ -23,6 +25,12 @@ module.exports = class StreamCopyMetrics {
|
||||
}
|
||||
|
||||
end(rows = null, error = null) {
|
||||
if (this.ended) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.ended = true;
|
||||
|
||||
if (Number.isInteger(rows)) {
|
||||
this.rows = rows;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user