Commit 7e18b72
committed
bug #59581 [Cache] Don't clear system caches on
This PR was merged into the 6.4 branch.
Discussion
----------
[Cache] Don't clear system caches on `cache:clear`
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix #59445
| License | MIT
As spotted by `@MatTheCat` in symfony/symfony#59445 (comment), non-optional cache warmers currently cannot use any cache pools derived from the `cache.system` one.
The reason is that when running `cache:clear` with no `var/cache` folder, we skip running those cache warmers since they already ran to execute the command, but we still call the cache clearer service, which empties system pools at the moment, annihilating anything non-optional cache warmers put in these pools.
I propose to fix this by just not clearing cache pools derived from the system pool anymore. System pools are meant to we stored in the `kernel.cache_dir` anyway, so they're already cleared when `cache:clear` empties that folder.
Commits
-------
8e820561295 [Cache] Don't clear system caches on cache:clearcache:clear (nicolas-grekas)File tree
3 files changed
+12
-17
lines changed- Tests/Functional
- app/CachePools
3 files changed
+12
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 91 | | |
96 | 92 | | |
97 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
0 commit comments