mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 21:15:06 +02:00
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:
@@ -268,6 +268,7 @@ export async function upgradeModel (
|
||||
|
||||
const { hierarchy, modelDb, model } = await buildModel(ctx, newModel)
|
||||
const { migrateClient: preMigrateClient } = await prepareMigrationClient(
|
||||
ctx,
|
||||
pipeline,
|
||||
hierarchy,
|
||||
modelDb,
|
||||
@@ -302,6 +303,7 @@ export async function upgradeModel (
|
||||
})
|
||||
|
||||
const { migrateClient, migrateState } = await prepareMigrationClient(
|
||||
ctx,
|
||||
pipeline,
|
||||
hierarchy,
|
||||
modelDb,
|
||||
@@ -390,6 +392,7 @@ export async function upgradeModel (
|
||||
}
|
||||
|
||||
async function prepareMigrationClient (
|
||||
ctx: MeasureContext,
|
||||
pipeline: Pipeline,
|
||||
hierarchy: Hierarchy,
|
||||
model: ModelDb,
|
||||
@@ -410,7 +413,8 @@ async function prepareMigrationClient (
|
||||
storageAdapter,
|
||||
accountClient,
|
||||
wsIds,
|
||||
queue
|
||||
queue,
|
||||
ctx
|
||||
)
|
||||
const states = await migrateClient.find<MigrationState>(DOMAIN_MIGRATION, { _class: core.class.MigrationState })
|
||||
const sts = Array.from(groupByArray(states, (it) => it.plugin).entries())
|
||||
|
||||
@@ -36,13 +36,14 @@ export class MigrateClientImpl implements MigrationClient {
|
||||
readonly storageAdapter: StorageAdapter,
|
||||
readonly accountClient: AccountClient,
|
||||
readonly wsIds: WorkspaceIds,
|
||||
readonly queue: PlatformQueueProducer<QueueWorkspaceMessage>
|
||||
readonly queue: PlatformQueueProducer<QueueWorkspaceMessage>,
|
||||
ctx?: MeasureContext
|
||||
) {
|
||||
if (this.pipeline.context.lowLevelStorage === undefined) {
|
||||
throw new Error('lowLevelStorage is not defined')
|
||||
}
|
||||
this.lowLevel = this.pipeline.context.lowLevelStorage
|
||||
this.ctx = new MeasureMetricsContext('migrateClient', {})
|
||||
this.ctx = ctx ?? new MeasureMetricsContext('migrateClient', {})
|
||||
}
|
||||
|
||||
migrateState = new Map<string, Set<string>>()
|
||||
|
||||
Reference in New Issue
Block a user