Skip to content

Commit

Permalink
2023.09.30 Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
monkenWu committed Sep 30, 2023
2 parents bda1fcd + d47901a commit 9a9781c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/Orchestration/Saga/Cache/CacheFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace SDPMlab\Anser\Orchestration\Saga\Cache;

use SDPMlab\Anser\Orchestration\Saga\Cache\Redis\PRedisHandler;
use SDPMlab\Anser\Orchestration\Saga\Cache\Redis\PhpRedisHandler;
use SDPMlab\Anser\Orchestration\Saga\Cache\CacheHandlerInterface;
use SDPMlab\Anser\Exception\RedisException;

Expand Down Expand Up @@ -44,11 +43,9 @@ class CacheFactory
*/
public static function initCacheDriver(string $driver, $config = null, $option = null): CacheHandlerInterface
{
$cacheDriver = ucfirst(strtolower($driver));

if (isset(self::$cacheMapping[$cacheDriver])) {
if (isset(self::$cacheMapping[$driver])) {
self::$driver = $driver;
self::$cacheInstance = new self::$cacheMapping[$cacheDriver]($config, $option);
self::$cacheInstance = new self::$cacheMapping[$driver]($config, $option);
return self::$cacheInstance;
} else {
throw RedisException::forCacheDriverNotFound($driver);
Expand Down
3 changes: 1 addition & 2 deletions src/Orchestration/Saga/Restarter/Restarter.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ protected function handleRuntimeOrchArrayCompensate(array $runtimeOrchArray, str

// Compensate
$compensateResult[$runtimeOrch->getOrchestratorNumber()] = [
"compensateResult" => $runtimeOrch->startOrchCompensation(),
"runtimeOrchestrator" => $runtimeOrch
"compensateResult" => $runtimeOrch->startOrchCompensation()
];

if ($compensateResult[$runtimeOrch->getOrchestratorNumber()] === false) {
Expand Down

0 comments on commit 9a9781c

Please sign in to comment.