grepmax 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib/index/syncer.js
CHANGED
|
@@ -226,6 +226,16 @@ function initialSync(options) {
|
|
|
226
226
|
// Scope checks to this project's paths only
|
|
227
227
|
const projectKeys = yield metaCache.getKeysWithPrefix(rootPrefix);
|
|
228
228
|
(0, logger_1.log)("index", `Cached files: ${projectKeys.size}`);
|
|
229
|
+
// Coherence check: if LMDB has entries but LanceDB has no vectors for
|
|
230
|
+
// this project, the vector store was wiped (e.g. compaction failure,
|
|
231
|
+
// manual cleanup). Clear the stale cache so files get re-embedded.
|
|
232
|
+
if (projectKeys.size > 0 && !(yield vectorDb.hasRowsForPath(rootPrefix))) {
|
|
233
|
+
(0, logger_1.log)("index", `Stale cache detected: ${projectKeys.size} cached files but no vectors — clearing cache`);
|
|
234
|
+
for (const key of projectKeys) {
|
|
235
|
+
metaCache.delete(key);
|
|
236
|
+
}
|
|
237
|
+
projectKeys.clear();
|
|
238
|
+
}
|
|
229
239
|
const modelChanged = (0, index_config_1.checkModelMismatch)(paths.configPath);
|
|
230
240
|
if (reset || modelChanged) {
|
|
231
241
|
if (modelChanged) {
|
package/package.json
CHANGED