-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Cannot configure chain adapter #32139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Seems this is related to this one? |
Thank you. Yes. I think so. I’ll test and confirm. I’ll make sure to update the docs if fixed. |
Hm.. There is definitely some weird behaviour here: This is my (semi) working example framework:
cache:
pools:
cache.array:
adapter: cache.adapter.array
cache.apcu:
adapter: cache.adapter.apcu
services:
cache.app:
class: Symfony\Component\Cache\Adapter\ChainAdapter
arguments:
- [ '@cache.array', '@cache.apcu']
- 2419200 # One month But if I try to add the
This is indeed because of CachePoolPass line 109 This would be fine (but strange).. however, other services are using |
So with some help from Symfony Slack, I now know the following:
So, I can do something like this: framework:
cache:
app: cache.chain
pools:
cache.chain:
adapter: cache.adapter.psr6 # ProxyAdapter
provider: my_chain_provider
cache.array:
adapter: cache.adapter.array
cache.apcu:
adapter: cache.adapter.apcu
services:
my_chain_provider:
class: Symfony\Component\Cache\Adapter\ChainAdapter
arguments:
- [ '@cache.array', '@cache.apcu']
- 2419200 # One month I've updated the PR to the docs: symfony/symfony-docs#11813 Thank you for the help. |
…yholm) This PR was submitted for the 4.3 branch but it was squashed and merged into the 3.4 branch instead (closes #11813). Discussion ---------- [Cache] Make sure the chain cache configuration works I just tried the configuration and noticed a few issues. ~~Im not 100% sure this actually works.~~ Lets wait for symfony/symfony#32139 Im sure now Commits ------- 9fbebaf [Cache] Make sure the chain cache configuration works
I created the cache chain with cache.adapter.redis as my first choice and cache.adapter.array the second. I expected this chain setting will auto switch to cache.adapter.array if redis server is not available. But symfony throws error when I shut down the redis server. What I'm doing here. (symfony 5.1)
|
That's not what a chain is for. Please use support channels if you need help. |
Symfony version(s) affected: 3.4.x
Description
When trying to configure a cache
ChainAdapter
I get the following error:If I look in my container dump I see the following:
How to reproduce
Add the following contents to
cache.yaml
:Possible Solution
I've debugged some but I cannot figure out a good solution nor the cause.
The text was updated successfully, but these errors were encountered: