Skip to content

Commit 0b6522f

Browse files
committed
fix lancedb indexing bug
1 parent 65bbb20 commit 0b6522f

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

core/indexing/LanceDbIndex.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export class LanceDbIndex implements CodebaseIndex {
216216
let needToCreateTable = !existingTables.includes(tableName);
217217

218218
const addComputedLanceDbRows = async (
219-
pathAndCacheKey: PathAndCacheKey,
219+
pathAndCacheKeys: PathAndCacheKey[],
220220
computedRows: LanceDbRow[],
221221
) => {
222222
// Create table if needed, add computed rows
@@ -236,7 +236,7 @@ export class LanceDbIndex implements CodebaseIndex {
236236
}
237237

238238
// Mark item complete
239-
await markComplete([pathAndCacheKey], IndexResultType.Compute);
239+
await markComplete(pathAndCacheKeys, IndexResultType.Compute);
240240
};
241241

242242
// Check remote cache
@@ -285,7 +285,7 @@ export class LanceDbIndex implements CodebaseIndex {
285285
);
286286
}
287287

288-
await addComputedLanceDbRows({ cacheKey, path }, rows);
288+
await addComputedLanceDbRows([{ cacheKey, path }], rows);
289289
}
290290

291291
// Remove items that don't need to be recomputed
@@ -307,18 +307,7 @@ export class LanceDbIndex implements CodebaseIndex {
307307

308308
const dbRows = await this.computeRows(results.compute);
309309
await this.insertRows(sqlite, dbRows);
310-
await Promise.all(
311-
results.compute.map((result) => {
312-
addComputedLanceDbRows(
313-
result,
314-
dbRows.filter(
315-
(row) =>
316-
row.path === result.path && row.cachekey === result.cacheKey,
317-
),
318-
);
319-
}),
320-
);
321-
await markComplete(results.compute, IndexResultType.Compute);
310+
await addComputedLanceDbRows(results.compute, dbRows);
322311
let accumulatedProgress = 0;
323312

324313
// Add tag - retrieve the computed info from lance sqlite cache

0 commit comments

Comments
 (0)