Symfony 4.3,redis 缓存池的 tags:true 选项未实现 TagAware ItemInterface

Symfony 4.3, tags:true option for redis cache pool does not implement TagAware ItemInterface

使用 symfony 4.3,我已经配置了一个缓存池,该缓存池应该启用 TagAwarable 来缓存项目。 配置是这样的:

framework:
cache:
    #app: cache.adapter.redis
    default_redis_provider: 'redis://%env(REDIS_HOST)%:%env(int:REDIS_PORT)%'

    pools:
        redis.cache:
            adapter: '%framework_cache_adapter%'
            provider: 'redis://%env(REDIS_HOST)%:%env(int:REDIS_PORT)%'
            default_lifetime: '%framework_cache_lifetime%'
            tags: true

在代码中,使用依赖注入,我使用池名称检索 CacheInterface 并尝试对其进行标记,这会引发以下异常:

Cache item "appSettings" comes from a non tag-aware pool: you cannot tag it.

代码如下所示:

public function __construct(EntityManagerInterface $em, CacheInterface $redisCache)
{
    $this->m_cache = $redisCache;
    $this->m_entityManage = $em;
}

public function getKey(string $key) : ?string
{
    $appSettings = $this->m_cache->get(self::CACHE_KEY, function (ItemInterface $item) {
        $item->expiresAfter(3600);
        $item->tag([ 'settings', 'app_cache' ]);

        return $settings;
    });

    return $appSettings[$key] ?? null;
}

我尝试了不同的方法都无济于事,不知道如何从这里开始。

感谢任何帮助如何标记项目。

我遇到了同样的问题。
使用 \Symfony\Contracts\Cache\TagAwareCacheInterface 为我修复了它。

编辑
有关详细信息,请参阅 https://github.com/symfony/symfony/issues/33201