fix onStepAwaiting events (#7161)
This commit is contained in:
1 parent
11517f0faf
commit
edcafa140c
3 files changed
+9
-5
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/workflow-engine-redis": patch
|
||||||
|
"@medusajs/orchestration": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix onStepAwaiting event
|
||||||
@@ -720,6 +720,9 @@ export class TransactionOrchestrator extends EventEmitter {
|
|||||||
)
|
)
|
||||||
.then(async (response: any) => {
|
.then(async (response: any) => {
|
||||||
if (!step.definition.backgroundExecution) {
|
if (!step.definition.backgroundExecution) {
|
||||||
|
const eventName = DistributedTransactionEvent.STEP_AWAITING
|
||||||
|
transaction.emit(eventName, { step, transaction })
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,9 +755,6 @@ export class TransactionOrchestrator extends EventEmitter {
|
|||||||
|
|
||||||
await setStepFailure(error)
|
await setStepFailure(error)
|
||||||
})
|
})
|
||||||
|
|
||||||
const eventName = DistributedTransactionEvent.STEP_AWAITING
|
|
||||||
transaction.emit(eventName, { step, transaction })
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -573,9 +573,7 @@ export class WorkflowOrchestratorService {
|
|||||||
|
|
||||||
await notify({ eventType: "onStepAwaiting", step })
|
await notify({ eventType: "onStepAwaiting", step })
|
||||||
|
|
||||||
if (!step.definition.backgroundExecution) {
|
|
||||||
this.activeStepsCount--
|
this.activeStepsCount--
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onCompensateStepSuccess: async ({ step, transaction }) => {
|
onCompensateStepSuccess: async ({ step, transaction }) => {
|
||||||
|
|||||||
Reference in new issue
Block a user