UBERF-11533: Speed up gmail migration (#9257)

Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
Artyom Savchenko
2025-06-16 19:06:58 +07:00
committed by GitHub
parent 5250152a64
commit 5b3cb9f84d
+6 -1
View File
@@ -247,6 +247,7 @@ async function getSocialKeyByOldAccount (ws: WorkspaceInfoWithStatus, userId: st
}
async function getSociaKeysMap (ws: WorkspaceInfoWithStatus): Promise<Record<string, string>> {
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<Doc>[]
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