Commit 942aab8
committed
bug symfony#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 symfony#59445
| License | MIT
As spotted by `@MatTheCat` in 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
-------
8e82056 [Cache] Don't clear system caches on cache:clearcache:clear (nicolas-grekas)File tree
4 files changed
+12
-21
lines changed- src/Symfony
- Bundle/FrameworkBundle/Tests/Functional
- app/CachePools
- Component/Cache/DependencyInjection
4 files changed
+12
-21
lines changedLines changed: 0 additions & 4 deletions
| 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 | | |
| |||
Lines changed: 12 additions & 8 deletions
| 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 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | 200 | | |
205 | 201 | | |
206 | 202 | | |
| |||
0 commit comments