8000 [FrameworkBundle] Clear cache pools · Issue #22047 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[FrameworkBundle] Clear cache pools #22047
Closed
@theofidry

Description

@theofidry
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version 3.3.0 (master)

Here is what you get when you try to clear the cache pools without any argument:

$ bin/console cache:pool:clear

[OK] Cache was successfully cleared.

Which is completely false: you didn't clear anything. An example of output when it works:

$ bin/console cache:pool:clear cache.app

 // Clearing cache pool: cache.app

 [OK] Cache was successfully cleared.

I think a more intuitive behaviour, to be consistent with other commands, is that when no argument is passed all the pools are cleared.

EDIT: the part above has been dealt with #22159.

Actually I can see that I wasn't the only one thinking about this, but has been dismissed as dimmed too dangerous. I would like to argue for this still:

  • First it's plain annoying without it if you really want to clear everything: you have to check the config to list the existing pools, and add the complete list manually, then synchronize it later. Alternatively, you can find a smarter way to retrieve the list, but in any case, it requires a bit of tickling on the user end.
  • It is dangerous yes, but not more than a regular cache:clear...
  • If we really want to avoid mistakes, we should have a prompt command, like for migrations or schema update. As I believe cache:clear and cache:pool:clear calls can be fairly common in dev, maybe we could not prompt that when the environment is prod

Regardless of this discussion, I think the current message is misleading and should be change to something along the lines:

$ bin/console cache:pool:clear

[WARNING]: no pool to clear found.

[OK] Cache was successfully cleared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CacheDXDX = Developer eXperience (anything that improves the experience of using Symfony)FrameworkBundle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0