Skip to content

Commit 4ed2ed4

Browse files
authored
perf(plugin-search): improve search cache (#451)
1 parent 149d318 commit 4ed2ed4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/plugin-search/src/node/prepareSearchIndex.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ export async function onSearchIndexRemoved(
9292
const locale = page.pathLocale
9393
const index = getIndexByLocale(locale, searchOptions)
9494
const cache = getIndexCache(fileId)
95-
index.removeAll(cache)
95+
if (cache && cache.length)
96+
index.removeAll(cache)
9697
await writeTemp(app)
9798
}
9899
}

0 commit comments

Comments
 (0)