duplicator improvements

This commit is contained in:
Jan Prochazka
2023-02-16 17:25:54 +01:00
parent b514f8ae35
commit fb1c2c61fb
3 changed files with 65 additions and 6 deletions

View File

@@ -91,6 +91,7 @@ class DuplicatorItemHolder {
let inserted = 0;
let mapped = 0;
let missing = 0;
let lastLogged = new Date();
const writeStream = createAsyncWriteStream(this.duplicator.stream, {
processItem: async chunk => {
@@ -146,6 +147,13 @@ class DuplicatorItemHolder {
break;
}
}
if (new Date().getTime() - lastLogged.getTime() > 5000) {
logger.info(
`Duplicating ${this.item.name} in progress, inserted ${inserted} rows, mapped ${mapped} rows, missing ${missing} rows`
);
lastLogged = new Date();
}
// this.idMap[oldId] = newId;
},
});