From da0cc9e3f71397b0c68610cb3f031aa86da71fa9 Mon Sep 17 00:00:00 2001 From: MonkenWu Date: Wed, 27 Sep 2023 22:18:53 +0800 Subject: [PATCH] 2023.09.27 Modify the manner of triggering compensation. --- src/Orchestration/Orchestrator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Orchestration/Orchestrator.php b/src/Orchestration/Orchestrator.php index 0315caf..d0f449b 100644 --- a/src/Orchestration/Orchestrator.php +++ b/src/Orchestration/Orchestrator.php @@ -279,7 +279,8 @@ public function startAllStep(CacheHandlerInterface $cacheInstance = null) if ($this->isSuccess() === false) { if (is_null($this->sagaInstance) === false) { - if (!$this->startOrchCompensation() || is_null($this->startOrchCompensation())) { + $transResult = $this->startOrchCompensation(); + if (!$transResult || is_null($transResult)) { if($this->defineFailResult() instanceof OrchestratorException) { throw OrchestratorException::forStepExecuteFail(static::class, "compensate"); }