From 01acf9e7009300c01544f022c2a97d4d3f0fdb65 Mon Sep 17 00:00:00 2001 From: "Carlos R. L. Rodrigues" <37986729+carlos-r-l-rodrigues@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:12:08 -0300 Subject: [PATCH] fix(orchestration): avoid retry when finished (#10913) --- .changeset/chilled-schools-collect.md | 5 +++++ .../orchestration/src/transaction/distributed-transaction.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/chilled-schools-collect.md diff --git a/.changeset/chilled-schools-collect.md b/.changeset/chilled-schools-collect.md new file mode 100644 index 0000000000..7b141e1602 --- /dev/null +++ b/.changeset/chilled-schools-collect.md @@ -0,0 +1,5 @@ +--- +"@medusajs/orchestration": patch +--- + +fix(orchestration): avoid retry when finished diff --git a/packages/core/orchestration/src/transaction/distributed-transaction.ts b/packages/core/orchestration/src/transaction/distributed-transaction.ts index 8c84add8b8..afa5d280eb 100644 --- a/packages/core/orchestration/src/transaction/distributed-transaction.ts +++ b/packages/core/orchestration/src/transaction/distributed-transaction.ts @@ -244,6 +244,10 @@ class DistributedTransaction extends EventEmitter { step: TransactionStep, interval: number ): Promise { + if (this.hasFinished()) { + return + } + await this.saveCheckpoint() await DistributedTransaction.keyValueStore.scheduleRetry( this,