fix onStepAwaiting events (#7161)

This commit is contained in:
Carlos R. L. Rodrigues authored and GitHub committed 2024-04-29 18:55:41 +02:00
1 parent 11517f0faf
commit edcafa140c
3 files changed
+9 -5

No files matched your search

+6
View File
@@ -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 }) => {