-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Open
Description
Symfony version(s) affected
7.3.0
Description
As per docs, lock resouce can be dsn or service id, but service id doesn't work. It is throwing "Unsupported Connection: shared.cache" error.
Here is my cache config.
<?php
declare(strict_types=1);
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Symfony\Config\FrameworkConfig;
return static function (ContainerConfigurator $containerConfigurator, FrameworkConfig $frameworkConfig): void {
$cacheConfig = $frameworkConfig->cache();
$cacheConfig
->defaultRedisProvider('%env(REDIS_URL)%')
->prefixSeed('qbil-trade.%kernel.environment%')
->app('cache.adapter.redis')
->system('cache.adapter.system');
$cacheConfig
->pool('shared.cache')
->adapters(['cache.adapter.redis']);
};
And here is my lock config
<?php
declare(strict_types=1);
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Symfony\Config\FrameworkConfig;
return static function (FrameworkConfig $frameworkConfig): void {
$frameworkConfig
->lock()
->resource('default', ['%env(LOCK_DSN)%']);
$frameworkConfig
->lock()
->resource('shared', ['shared.cache']);
};
shared.cache
is service id (debug:container shows it too)
How to reproduce
Configure cache pools like the example above and use a pool as lock resource, it won't work.
Possible Solution
No response
Additional Context
No response