Commit 77eb3c2
committed
fix: prevent race condition in flushModels with refresh
Keep old cache in memory when refresh=true to avoid gap in cache
availability. This prevents getModels() from triggering a fresh API
fetch if called immediately after flushModels(router, true).
The refreshModels() function will atomically replace the memory cache
when the refresh completes, maintaining graceful degradation.1 parent effc83e commit 77eb3c2
1 file changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | | - | |
263 | 261 | | |
264 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
268 | 271 | | |
269 | 272 | | |
270 | 273 | | |
| |||
0 commit comments