Commit f25d534
fix(search): save index even when some pages fail to load
When the search plugin indexes pages in auto mode, if any page fails to
load (e.g. 404), the fetch promise rejects with no error handler. This
means `count` never reaches `len`, so `saveData` is never called and the
entire search index is lost — even for pages that loaded successfully.
Add an error handler to the `.then()` call that still increments the
counter, ensuring the search index is saved with whatever pages were
successfully fetched.
Fixes #2674
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent f4c37e0 commit f25d534
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
341 | 346 | | |
342 | 347 | | |
343 | 348 | | |
0 commit comments