From a3ea16abb9c3eae5fb9df413c20e7980848d16f8 Mon Sep 17 00:00:00 2001 From: John Mortlock Date: Sun, 27 Oct 2024 15:33:58 +1030 Subject: [PATCH] Caches uses RoadRunner RPC cache setting from the environment --- .../RoadRunnerActivityInvocationCache.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Worker/ActivityInvocationCache/RoadRunnerActivityInvocationCache.php b/src/Worker/ActivityInvocationCache/RoadRunnerActivityInvocationCache.php index 05ed8195..c9ab2a12 100644 --- a/src/Worker/ActivityInvocationCache/RoadRunnerActivityInvocationCache.php +++ b/src/Worker/ActivityInvocationCache/RoadRunnerActivityInvocationCache.php @@ -6,6 +6,7 @@ use React\Promise\PromiseInterface; use Spiral\Goridge\RPC\RPC; +use Spiral\RoadRunner\Environment; use Spiral\RoadRunner\KeyValue\Factory; use Spiral\RoadRunner\KeyValue\StorageInterface; use Temporal\DataConverter\DataConverter; @@ -31,7 +32,8 @@ public function __construct(string $host, string $cacheName, DataConverterInterf public static function create(DataConverterInterface $dataConverter = null): self { - return new self('tcp://127.0.0.1:6001', self::CACHE_NAME, $dataConverter); + $env = Environment::fromGlobals(); + return new self($env->getRPCAddress(), self::CACHE_NAME, $dataConverter); } public function clear(): void