zen-fs-config 0.3.22 → 0.3.24

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.
package/dist/index.js CHANGED
@@ -667,20 +667,11 @@ var ConfigRepo = class {
667
667
  */
668
668
  async syncMetaToReplicas() {
669
669
  this.assertNotDisposed();
670
- try {
671
- const content = await this.cachedFS.readFile(BACKENDS_FILE);
672
- const vPath = versionPathFor(BACKENDS_FILE);
673
- const vContent = await this.cachedFS.readFile(vPath);
674
- for (const [id, replica] of this.replicaBackends) {
675
- try {
676
- await replica.syncable.writeFile(BACKENDS_FILE, content);
677
- await replica.syncable.writeFile(vPath, vContent);
678
- console.log(`[ConfigRepo] Synced ${BACKENDS_FILE} + .version to replica ${id}`);
679
- } catch (err) {
680
- console.error(`[ConfigRepo] Failed to sync ${BACKENDS_FILE} to ${id}:`, err.message);
681
- }
682
- }
683
- } catch {
670
+ const results = await this.flush();
671
+ for (const result of results) {
672
+ console.log(
673
+ `[ConfigRepo] syncMetaToReplicas: ${result.pairId} +${result.filesCreated}/~${result.filesUpdated}/-${result.filesDeleted} skip:${result.filesSkipped} ${result.durationMs}ms`
674
+ );
684
675
  }
685
676
  }
686
677
  getSyncStatuses() {
package/dist/index.mjs CHANGED
@@ -618,20 +618,11 @@ var ConfigRepo = class {
618
618
  */
619
619
  async syncMetaToReplicas() {
620
620
  this.assertNotDisposed();
621
- try {
622
- const content = await this.cachedFS.readFile(BACKENDS_FILE);
623
- const vPath = versionPathFor(BACKENDS_FILE);
624
- const vContent = await this.cachedFS.readFile(vPath);
625
- for (const [id, replica] of this.replicaBackends) {
626
- try {
627
- await replica.syncable.writeFile(BACKENDS_FILE, content);
628
- await replica.syncable.writeFile(vPath, vContent);
629
- console.log(`[ConfigRepo] Synced ${BACKENDS_FILE} + .version to replica ${id}`);
630
- } catch (err) {
631
- console.error(`[ConfigRepo] Failed to sync ${BACKENDS_FILE} to ${id}:`, err.message);
632
- }
633
- }
634
- } catch {
621
+ const results = await this.flush();
622
+ for (const result of results) {
623
+ console.log(
624
+ `[ConfigRepo] syncMetaToReplicas: ${result.pairId} +${result.filesCreated}/~${result.filesUpdated}/-${result.filesDeleted} skip:${result.filesSkipped} ${result.durationMs}ms`
625
+ );
635
626
  }
636
627
  }
637
628
  getSyncStatuses() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-fs-config",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
4
4
  "description": "Distributed config management library built on ZenFS, zen-fs-cache, and zen-fs-sync",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",