mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-22 01:25:00 +02:00
remove mutex (#7056)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -23,9 +23,12 @@ export class ConnectionMgrMiddleware extends BaseMiddleware implements Middlewar
|
||||
if (ctx.id === undefined) {
|
||||
ctx.id = generateId()
|
||||
}
|
||||
ctx.onEnd = async (_ctx: MeasureContext) => {
|
||||
await this.context.adapterManager?.closeContext?.(_ctx)
|
||||
}
|
||||
const result = await this.provideTx(ctx, tx)
|
||||
this.context.endContext = async (_ctx: MeasureContext) => {
|
||||
await this.context.adapterManager?.closeContext?.(ctx)
|
||||
if (ctx.onEnd !== undefined) {
|
||||
await ctx.onEnd(ctx)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import core, {
|
||||
type TxRemoveDoc,
|
||||
type TxUpdateDoc,
|
||||
addOperation,
|
||||
generateId,
|
||||
toFindResult,
|
||||
withContext
|
||||
} from '@hcengineering/core'
|
||||
@@ -225,11 +226,16 @@ export class TriggersMiddleware extends BaseMiddleware implements Middleware {
|
||||
)
|
||||
|
||||
if (aresult.length > 0) {
|
||||
await this.processDerivedTxes(ctx, aresult)
|
||||
// We need to send all to recipients
|
||||
await this.context.head?.handleBroadcast(ctx)
|
||||
await ctx.with('process-aync-result', {}, async (ctx) => {
|
||||
ctx.id = generateId()
|
||||
await this.processDerivedTxes(ctx, aresult)
|
||||
// We need to send all to recipients
|
||||
await this.context.head?.handleBroadcast(ctx)
|
||||
if (ctx.onEnd !== undefined) {
|
||||
await ctx.onEnd(ctx)
|
||||
}
|
||||
})
|
||||
}
|
||||
await this.context.endContext?.(ctx)
|
||||
}
|
||||
|
||||
private async processDerivedTxes (ctx: MeasureContext<SessionData>, derived: Tx[]): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user