Skip to content

Commit

Permalink
perf(plugin-search): improve search cache (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo authored Jan 27, 2025
1 parent 149d318 commit 4ed2ed4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/plugin-search/src/node/prepareSearchIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export async function onSearchIndexRemoved(
const locale = page.pathLocale
const index = getIndexByLocale(locale, searchOptions)
const cache = getIndexCache(fileId)
index.removeAll(cache)
if (cache && cache.length)
index.removeAll(cache)
await writeTemp(app)
}
}
Expand Down

0 comments on commit 4ed2ed4

Please sign in to comment.