Commit 2b4ed9b
committed
refactor: replace doRevalFn closure with direct filter reference in revalJob
Replace the func() closure field on revalJob with a *cacheFilter pointer
and call job.filter.doRevalidate(job.key, job.req) directly in the worker.
The closure was only binding key and req, which revalJob already carries as
fields, making the indirection unnecessary.
Also fixes two missing spec.Close() calls in TestCreateFilter_InvalidArgs and
TestCacheFilter_SharedStorage_RouteIsolation that caused goroutine leaks.
Signed-off-by: larry-dalmeida <hello@larrydalmeida.com>1 parent 4a7f535 commit 2b4ed9b
2 files changed
Lines changed: 14 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
| 209 | + | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
238 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
712 | 710 | | |
713 | 711 | | |
714 | 712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| 268 | + | |
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
| |||
1319 | 1321 | | |
1320 | 1322 | | |
1321 | 1323 | | |
| 1324 | + | |
1322 | 1325 | | |
1323 | 1326 | | |
1324 | 1327 | | |
| |||
2804 | 2807 | | |
2805 | 2808 | | |
2806 | 2809 | | |
2807 | | - | |
| 2810 | + | |
2808 | 2811 | | |
2809 | | - | |
| 2812 | + | |
2810 | 2813 | | |
2811 | 2814 | | |
2812 | 2815 | | |
| |||
0 commit comments