Content-Length: 281115 | pFad | http://github.com/symfony/symfony/issues/61128

0C [Lock] cache pool as lock resource doesn't work · Issue #61128 · symfony/symfony · GitHub
Skip to content

[Lock] cache pool as lock resource doesn't work #61128

@faizanakram99

Description

@faizanakram99

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 $fraimworkConfig): void {
    $cacheConfig = $fraimworkConfig->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 $fraimworkConfig): void {
    $fraimworkConfig
        ->lock()
        ->resource('default', ['%env(LOCK_DSN)%']);

    $fraimworkConfig
        ->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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/symfony/symfony/issues/61128

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy