@tmlmobilidade/utils 20260726.1208.42 → 20260726.1412.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,6 +56,7 @@ export async function replicate({ countDestinationDbFn, countSourceDbFn, deleteD
56
56
  // and write them to the Destination database.
57
57
  const missingStepTimer = new Timer();
58
58
  if (missingDocumentIds.length > 0) {
59
+ console.info(`Syncing ${missingDocumentIds.length} missing documents to the Destination database...`);
59
60
  for await (const sourceDbDocument of missingDocumentsSourceDbAsyncIterator(missingDocumentIds)) {
60
61
  await writeSourceDocumentToDestinationDbFn(sourceDbDocument);
61
62
  }
@@ -66,14 +67,17 @@ export async function replicate({ countDestinationDbFn, countSourceDbFn, deleteD
66
67
  // as they are not present in the source database.
67
68
  const deleteStepTimer = new Timer();
68
69
  if (extraDocumentIds.length > 0 && deleteDestinationDbFn) {
70
+ console.info(`Deleting ${extraDocumentIds.length} extra documents in the Destination database...`);
69
71
  await deleteDestinationDbFn(extraDocumentIds);
70
72
  console.info(`Deleted ${extraDocumentIds.length} extra documents in the Destination database. (${deleteStepTimer.get()})`);
71
73
  }
72
74
  //
73
75
  // After syncing the missing documents,
74
76
  // run the onComplete callback function if provided.
75
- if (onCompleteCallbackFn)
77
+ if (onCompleteCallbackFn) {
78
+ console.info(`Running onComplete callback function...`);
76
79
  await onCompleteCallbackFn();
80
+ }
77
81
  console.info(`Replication complete (${globalTimer.get()})`);
78
82
  //
79
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/utils",
3
- "version": "20260726.1208.42",
3
+ "version": "20260726.1412.44",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"