From 0fcedf397f2ff299c35aab3b52c5c28733bb4ead Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Sun, 21 Jan 2024 14:31:39 +0800 Subject: [PATCH] concurrency should not influence the sync --- src/sync.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/sync.ts b/src/sync.ts index 1180ec1..1e2f8a1 100644 --- a/src/sync.ts +++ b/src/sync.ts @@ -1427,34 +1427,6 @@ export const doActualSync = async ( log.debug(`finish syncing extra data firstly`); log.debug(`concurrency === ${concurrency}`); - if (concurrency === 1) { - // run everything in sequence - // good old way - for (let i = 0; i < sortedKeys.length; ++i) { - const key = sortedKeys[i]; - const val = mixedStates[key]; - - log.debug(`start syncing "${key}" with plan ${JSON.stringify(val)}`); - - if (callbackSyncProcess !== undefined) { - await callbackSyncProcess(i, totalCount, key, val.decision); - } - - await dispatchOperationToActual( - key, - vaultRandomID, - val, - client, - db, - vault, - localDeleteFunc, - password - ); - log.debug(`finished ${key}`); - } - - return; // shortcut return, avoid too many nests below - } const { folderCreationOps, deletionOps, uploadDownloads, realTotalCount } = splitThreeSteps(syncPlan, sortedKeys);