From 5b3cb9f84d72c04701b7445cd0f71b2381aa5e79 Mon Sep 17 00:00:00 2001 From: Artyom Savchenko Date: Mon, 16 Jun 2025 19:06:58 +0700 Subject: [PATCH] UBERF-11533: Speed up gmail migration (#9257) Signed-off-by: Artem Savchenko --- dev/tool/src/gmail.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev/tool/src/gmail.ts b/dev/tool/src/gmail.ts index 655f18a3f2..94cdb1e83e 100644 --- a/dev/tool/src/gmail.ts +++ b/dev/tool/src/gmail.ts @@ -247,6 +247,7 @@ async function getSocialKeyByOldAccount (ws: WorkspaceInfoWithStatus, userId: st } async function getSociaKeysMap (ws: WorkspaceInfoWithStatus): Promise> { + console.info('Loading accounts from workspace', ws.uuid, ws.name, ws.url) const systemAccounts = [core.account.System, core.account.ConfigUser] const accounts = await loadAccounts(ws) @@ -280,7 +281,11 @@ export async function loadAccounts (ws: WorkspaceInfoWithStatus): Promise<(Doc & const docs = (await client.loadDocs(DOMAIN_MODEL_TX, ids)).filter((it) => TxProcessor.isExtendsCUD(it._class) ) as TxCUD[] - accountsTxes.push(...docs) + for (const tx of docs) { + if (tx.objectClass === 'core:class:Account' || tx.objectClass === 'contact:class:PersonAccount') { + accountsTxes.push(tx) + } + } if (info.finished && idx !== undefined) { await client.closeChunk(info.idx) break