chore(): Workflow engine timers and notification improvements (#13434)

RESOLVES CORE-1177

**What**
main changes are:
- not blocking execution when notifying
- timers management
- race condition checks improvements
This commit is contained in:
Adrien de Peretti
2025-09-08 20:19:55 +02:00
committed by GitHub
parent b776fd55dc
commit fc4d5f0ac9
14 changed files with 464 additions and 213 deletions

View File

@@ -293,37 +293,24 @@ export class WorkflowsModuleService<
})
}
@InjectSharedContext()
async subscribe(
args: {
workflowId: string
transactionId?: string
subscriber: Function
subscriberId?: string
},
@MedusaContext() context: Context = {}
) {
async subscribe(args: {
workflowId: string
transactionId?: string
subscriber: Function
subscriberId?: string
}) {
return this.workflowOrchestratorService_.subscribe(args as any)
}
@InjectSharedContext()
async unsubscribe(
args: {
workflowId: string
transactionId?: string
subscriberOrId: string | Function
},
@MedusaContext() context: Context = {}
) {
async unsubscribe(args: {
workflowId: string
transactionId?: string
subscriberOrId: string | Function
}) {
return this.workflowOrchestratorService_.unsubscribe(args as any)
}
@InjectSharedContext()
async cancel(
workflowId: string,
options: WorkflowOrchestratorCancelOptions,
@MedusaContext() context: Context = {}
) {
async cancel(workflowId: string, options: WorkflowOrchestratorCancelOptions) {
return await this.workflowOrchestratorService_.cancel(workflowId, options)
}
}