Skip to content

Commit

Permalink
Caches uses RoadRunner RPC cache setting from the environment
Browse files Browse the repository at this point in the history
  • Loading branch information
jmortlock committed Oct 27, 2024
1 parent d789123 commit a3ea16a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit a3ea16a

Please sign in to comment.