mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-08 10:47:42 +02:00
UBERF-11533: Speed up gmail migration (#9257)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user