mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 15:34:03 +00:00
redis bootstrapper: support clusters (#1207)
This commit is contained in:
parent
e36157bd61
commit
e727e07212
1 changed files with 3 additions and 3 deletions
|
|
@ -29,10 +29,10 @@ class RedisTenancyBootstrapper implements TenancyBootstrapper
|
|||
$client = Redis::connection($connection)->client();
|
||||
|
||||
/** @var string $originalPrefix */
|
||||
$originalPrefix = $client->getOption($client::OPT_PREFIX);
|
||||
$originalPrefix = $client->getOption(\Redis::OPT_PREFIX);
|
||||
|
||||
$this->originalPrefixes[$connection] = $originalPrefix;
|
||||
$client->setOption($client::OPT_PREFIX, $prefix);
|
||||
$client->setOption(\Redis::OPT_PREFIX, $prefix);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ class RedisTenancyBootstrapper implements TenancyBootstrapper
|
|||
foreach ($this->prefixedConnections() as $connection) {
|
||||
$client = Redis::connection($connection)->client();
|
||||
|
||||
$client->setOption($client::OPT_PREFIX, $this->originalPrefixes[$connection]);
|
||||
$client->setOption(\Redis::OPT_PREFIX, $this->originalPrefixes[$connection]);
|
||||
}
|
||||
|
||||
$this->originalPrefixes = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue