Commit 39f77b5
committed
fix(cache): handle persistent cache write failures gracefully
Wraps cacache.put in try/catch to prevent test flakiness when persistent
cache writes fail or are slow. The in-memory cache is updated synchronously
before the persistent write, so immediate reads will succeed regardless of
persistent cache state.
Fixes flaky test: "should cache fetched value" in test/cache-with-ttl.test.ts1 parent d479a4a commit 39f77b5
1 file changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
372 | 378 | | |
373 | 379 | | |
374 | 380 | | |
| |||
0 commit comments