UBERF-8425: Improve parallel ws upgrade logging within one ws service (#9118)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev
2025-05-28 22:58:33 +07:00
committed by GitHub
parent ae0d06ef5f
commit 70c704d468
20 changed files with 163 additions and 171 deletions
+5 -7
View File
@@ -20,7 +20,7 @@ import {
} from '@hcengineering/model'
import { DOMAIN_PREFERENCE } from '@hcengineering/preference'
import workbench, { type WorkbenchTab } from '@hcengineering/workbench'
import core, { type AccountUuid, DOMAIN_TX, MeasureMetricsContext } from '@hcengineering/core'
import core, { type AccountUuid, DOMAIN_TX } from '@hcengineering/core'
import { getAccountUuidBySocialKey, getSocialKeyByOldAccount } from '@hcengineering/model-core'
import { workbenchId } from '.'
@@ -30,8 +30,7 @@ async function removeTabs (client: MigrationClient): Promise<void> {
}
async function migrateTabsToSocialIds (client: MigrationClient): Promise<void> {
const ctx = new MeasureMetricsContext('workbench migrateTabsToSocialIds', {})
ctx.info('migrating workbench tabs to social ids...')
client.logger.log('migrating workbench tabs to social ids...', {})
const socialKeyByAccount = await getSocialKeyByOldAccount(client)
const tabs = await client.find<WorkbenchTab>(DOMAIN_PREFERENCE, { _class: workbench.class.WorkbenchTab })
for (const tab of tabs) {
@@ -40,12 +39,11 @@ async function migrateTabsToSocialIds (client: MigrationClient): Promise<void> {
await client.update(DOMAIN_PREFERENCE, { _id: tab._id }, { attachedTo: newAttachedTo })
}
}
ctx.info('migrating workbench tabs to social ids completed...')
client.logger.log('migrating workbench tabs to social ids completed...', {})
}
async function migrateSocialIdsToGlobalAccounts (client: MigrationClient): Promise<void> {
const ctx = new MeasureMetricsContext('workbench migrateSocialIdsToGlobalAccounts', {})
ctx.info('migrating workbench tabs to global accounts...')
client.logger.log('migrating workbench tabs to global accounts...', {})
const accountUuidBySocialKey = new Map<string, AccountUuid | null>()
const tabs = await client.find<WorkbenchTab>(DOMAIN_PREFERENCE, { _class: workbench.class.WorkbenchTab })
@@ -55,7 +53,7 @@ async function migrateSocialIdsToGlobalAccounts (client: MigrationClient): Promi
await client.update(DOMAIN_PREFERENCE, { _id: tab._id }, { attachedTo: newAttachedTo })
}
}
ctx.info('migrating workbench tabs to global accounts completed...')
client.logger.log('migrating workbench tabs to global accounts completed...', {})
}
export const workbenchOperation: MigrateOperation = {