From 1864cfb0ead56ab2376adfed893e902f32ddbca6 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Sun, 7 Jul 2024 23:55:55 +0800 Subject: [PATCH] fix: improve syncing performance --- src/modules/sync/hooks.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/sync/hooks.ts b/src/modules/sync/hooks.ts index bd1a316..8adafd1 100644 --- a/src/modules/sync/hooks.ts +++ b/src/modules/sync/hooks.ts @@ -78,7 +78,7 @@ async function callSyncing( skippedCount = items.length - filteredItems.length; items = filteredItems; } - ztoolkit.log("sync start", reason, items, skippedCount); + ztoolkit.log("sync start", reason, items.length, skippedCount); if (!quiet) { progress = new ztoolkit.ProgressWindow( @@ -133,9 +133,11 @@ async function callSyncing( }); i += 1; } - ztoolkit.log("will be synced:", toExport, toImport, toDiff); - i = 1; + let totalCount = Object.keys(toExport).length; + ztoolkit.log("will be synced:", totalCount, toImport.length, toDiff.length); + + i = 1; for (const filepath of Object.keys(toExport)) { progress?.changeLine({ text: `[${getString("sync.running.hint.updateMD")}] ${i}/${