mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 12:35:02 +02:00
Pass meta to tx and queue (#9695)
+ Pass ctx context via platform queue + Fix queue contracts + Add meta to tx, skip store. Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
+2
-2
@@ -1667,7 +1667,7 @@ export async function restoreFromv6All (
|
||||
const queue = getPlatformQueue('tool', workspace.region)
|
||||
const wsProducer = queue.getProducer<QueueWorkspaceMessage>(ctx, QueueTopic.Workspace)
|
||||
|
||||
await wsProducer.send(uuid, [workspaceEvents.restoring()])
|
||||
await wsProducer.send(ctx, uuid, [workspaceEvents.restoring()])
|
||||
|
||||
const workspaceStorage: StorageAdapter = buildStorageFromConfig(storageConfig)
|
||||
|
||||
@@ -1693,7 +1693,7 @@ export async function restoreFromv6All (
|
||||
await sendTransactorEvent(uuid, 'force-close')
|
||||
|
||||
ctx.info('workspace restored', { dataId })
|
||||
await wsProducer.send(uuid, [workspaceEvents.restored()])
|
||||
await wsProducer.send(ctx, uuid, [workspaceEvents.restored()])
|
||||
|
||||
if (activeWorkspaces.has(uuid)) {
|
||||
// set workspace back to active
|
||||
|
||||
@@ -415,7 +415,7 @@ export function devTool (
|
||||
progress: 100
|
||||
})
|
||||
|
||||
await wsProducer.send(res.workspaceUuid, [workspaceEvents.created()])
|
||||
await wsProducer.send(measureCtx, res.workspaceUuid, [workspaceEvents.created()])
|
||||
await queue.shutdown()
|
||||
console.log(queue)
|
||||
})
|
||||
@@ -500,7 +500,7 @@ export function devTool (
|
||||
|
||||
console.log(metricsToString(measureCtx.metrics, 'upgrade', 60))
|
||||
|
||||
await wsProducer.send(info.uuid, [workspaceEvents.upgraded()])
|
||||
await wsProducer.send(measureCtx, info.uuid, [workspaceEvents.upgraded()])
|
||||
await queue.shutdown()
|
||||
console.log('upgrade-workspace done')
|
||||
})
|
||||
@@ -1160,7 +1160,7 @@ export function devTool (
|
||||
const queue = getPlatformQueue('tool', ws.region)
|
||||
const wsProducer = queue.getProducer<QueueWorkspaceMessage>(toolCtx, QueueTopic.Workspace)
|
||||
|
||||
await wsProducer.send(ws.uuid, [workspaceEvents.restoring()])
|
||||
await wsProducer.send(toolCtx, ws.uuid, [workspaceEvents.restoring()])
|
||||
|
||||
const workspaceStorage: StorageAdapter = buildStorageFromConfig(storageConfig)
|
||||
|
||||
@@ -1202,7 +1202,7 @@ export function devTool (
|
||||
}
|
||||
|
||||
console.log('workspace restored')
|
||||
await wsProducer.send(ws.uuid, [workspaceEvents.restored()])
|
||||
await wsProducer.send(toolCtx, ws.uuid, [workspaceEvents.restored()])
|
||||
} catch (err) {
|
||||
toolCtx.error('failed to restore', { err })
|
||||
}
|
||||
@@ -2226,7 +2226,7 @@ export function devTool (
|
||||
console.log('reindex workspace', workspace)
|
||||
const queue = getPlatformQueue('tool', ws.region)
|
||||
const wsProducer = queue.getProducer<QueueWorkspaceMessage>(toolCtx, QueueTopic.Workspace)
|
||||
await wsProducer.send(ws.uuid, [workspaceEvents.fullReindex()])
|
||||
await wsProducer.send(toolCtx, ws.uuid, [workspaceEvents.fullReindex()])
|
||||
await queue.shutdown()
|
||||
console.log('done', workspace)
|
||||
})
|
||||
@@ -2262,7 +2262,7 @@ export function devTool (
|
||||
console.log('reindex workspace', ws)
|
||||
const queue = getPlatformQueue('tool', ws.region)
|
||||
const wsProducer = queue.getProducer<QueueWorkspaceMessage>(toolCtx, QueueTopic.Workspace)
|
||||
await wsProducer.send(ws.uuid, [workspaceEvents.fullReindex()])
|
||||
await wsProducer.send(toolCtx, ws.uuid, [workspaceEvents.fullReindex()])
|
||||
await queue.shutdown()
|
||||
}
|
||||
console.log('done')
|
||||
|
||||
Reference in New Issue
Block a user