-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Implemented PruneableInterface on TagAwareAdapter #24075
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(with minor comment)
@@ -334,4 +335,16 @@ private function getTagVersions(array $tagsByKey) | |||
|
|||
return $tagVersions; | |||
} | |||
|
|||
/** | |||
* @return bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{@inheritdoc}
(note: should be merged in 3.4) |
3431f4a
to
130ef7b
Compare
Updated. I also wonder if we should also purge the |
About tagsAdapter, I wondered the same, and I have the same conclusion: since tags should be stored "forever", there can't be anything to prune. The code btw should bypass $defaultLifetime and force "forever", isn't it already the case?
true, but there is no way to have that "not used anymore" info, so nothing we can prune here (and if we could, there still would be a possible race condition, so better not look a it.) |
I searched the code and from what I understand, I can't see where that should happen. So I hoped maybe you could shed some light on it 😄 Imho an item is created using the
I would like to help out here but to be honest I really have a hard time understanding exactly how the tagging works internally. The whole closure stuff makes it pretty hard to understand if you're checking out the cache component internals for the first time. |
OK, these lines make the tags last "forever", by passing any default lifetime: So all is good PR ready. |
Documentation in symfony/symfony-docs#8209 PR amended to include note about how |
Thank you @Toflar. |
…lar) This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #24075). Discussion ---------- Implemented PruneableInterface on TagAwareAdapter | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | See comment on #23451 | License | MIT | Doc PR | Added a comment on symfony/symfony-docs#8209 The `ChainAdapter` already delegates the `prune()` calls. The `TagAwareAdapter` is a wrapping adapter too and should delegate the `prune()` calls just the same. Commits ------- b635b62 Implemented PruneableInterface on TagAwareAdapter
@nicolas-grekas I have to come back on this asking a question :)
I think that's where SQLite could help out. Can you maybe shed some light on why I would ever use the |
For sure, the PdoAdapter is here for you :) |
Thanks for the reply :) So I could use the |
Right now the relationships are not known by the underlying DB so you'd need to scan it. Tags are stored as serialized PHP arrays. Not what you need I guess. This would need work to allow clearing with a SQL query. |
The
ChainAdapter
already delegates theprune()
calls. TheTagAwareAdapter
is a wrapping adapter too and should delegate theprune()
calls just the same.