1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 21:34:04 +00:00

Revert condition in CacheManager to avoid excessive nesting

This commit is contained in:
lukinovec 2022-12-12 17:16:53 +01:00
parent b41d8d19dc
commit d3c7fef002

View file

@ -19,7 +19,10 @@ class CacheManager extends BaseCacheManager
public function __call($method, $parameters)
{
// todo0 Make PrefixCacheTenancyBootstrapper work with tags
if (tenancy()->initialized) {
if (! tenancy()->initialized) {
return parent::__call($method, $parameters);
}
$tags = [config('tenancy.cache.tag_base') . tenant()?->getTenantKey()];
if ($method === 'tags') {
@ -38,9 +41,6 @@ class CacheManager extends BaseCacheManager
return $this->store()->tags($tags)->$method(...$parameters);
}
return parent::__call($method, $parameters);
}
public function refreshStore(string|null $repository = null): void
{
$newStore = $this->resolve($repository ?? $this->getDefaultDriver())->getStore();