Skip to content

Commit

Permalink
fix onStepAwaiting events (#7161)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-r-l-rodrigues committed Apr 29, 2024
1 parent 11517f0 commit edcafa1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .changeset/twelve-crabs-clean.md
@@ -0,0 +1,6 @@
---
"@medusajs/workflow-engine-redis": patch
"@medusajs/orchestration": patch
---

Fix onStepAwaiting event
Expand Up @@ -720,6 +720,9 @@ export class TransactionOrchestrator extends EventEmitter {
)
.then(async (response: any) => {
if (!step.definition.backgroundExecution) {
const eventName = DistributedTransactionEvent.STEP_AWAITING
transaction.emit(eventName, { step, transaction })

return
}

Expand Down Expand Up @@ -752,9 +755,6 @@ export class TransactionOrchestrator extends EventEmitter {

await setStepFailure(error)
})

const eventName = DistributedTransactionEvent.STEP_AWAITING
transaction.emit(eventName, { step, transaction })
})
)
}
Expand Down
Expand Up @@ -573,9 +573,7 @@ export class WorkflowOrchestratorService {

await notify({ eventType: "onStepAwaiting", step })

if (!step.definition.backgroundExecution) {
this.activeStepsCount--
}
this.activeStepsCount--
},

onCompensateStepSuccess: async ({ step, transaction }) => {
Expand Down

0 comments on commit edcafa1

Please sign in to comment.