-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Add cache:pool:clear command #19891
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
5766a10
to
04b36c0
Compare
oh, yesterday I was thinking about it and want to create PR. You are the faster than me :D |
|
||
if ($pool instanceof CacheItemPoolInterface) { | ||
$pools[$id] = $pool; | ||
} elseif ($pool instanceof CacheClearerInterface) { |
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.
should be instanceof Psr6CacheClearer
04b36c0
to
3f96928
Compare
} | ||
|
||
foreach ($clearers as $id => $clearer) { | ||
$io->comment(sprintf('Calling cache clearer: <info>%s</info>', $id)); |
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.
I think the clearer/pool specific messages should be displayed only if the output is verbose and maybe a global comment should be added before e.g. "Clearing the cache for pools ...", wdyt?
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.
I don't know :) Doesn't look verbose to me. (Not as an exception trace e.g.). So I'll follow any advises.
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.
Sure, it's not very verbose until you have a lot of pools, I just refer to the clear cache command which hide details by default
3f96928
to
b8c9c25
Compare
{ | ||
$this | ||
->setName('cache:pool:clear') | ||
->setDefinition(array( |
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.
Just interesting - why not use addArgument
here?
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.
All the other commands use setDefinition
, that's the reason :)
b8c9c25
to
37c5b18
Compare
Thank you @nicolas-grekas. |
…s-grekas) This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] Add cache:pool:clear command | Q | A | ------------- | --- | Branch? | master | New feature? | yes | Tests pass? | yes | License | MIT Useful when deploying apps to get better control of cache pool clearing. Commits ------- 37c5b18 [FrameworkBundle] Add cache:pool:clear command
Useful when deploying apps to get better control of cache pool clearing.