-
Notifications
You must be signed in to change notification settings - Fork 517
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
Improve ProviderCache #904
Comments
Other solution for empty result is to add |
Oh, Hm. So the cache store empty responses if there is a chain and you got some exceptions, is that correct? I believe it is always valid to store empty responses. However, we should never store responses if an exception is thrown. |
Yes we save empty response on error when use chain. I am agree that empty response is valid response, but with chain we hide exceptions and this is problem. When |
I really think it is an issue so I will not close it. Im not a super fan of doing a workaround the problem. I would be much happier trying to fix the real issue. Could we change the Chain provider somehow? Say that we allow it to throw exception if (A) an exception is thrown and (B) no result is found. |
I'd be happy to create a PR for your solution if you want 😄 |
What are you think about add to ProviderCache flag
isAllowEmptyResult
?For example:
When have exceptions from providers the chain catch and return empty ArrayCollection.
This result is saved for 24h. I think will be good point if I don't save empty results.
Geocoder/src/Provider/Cache/ProviderCache.php
Lines 65 to 66 in 3565098
Here is example how I think can be:
What are you think about it?
The text was updated successfully, but these errors were encountered: