index files - cleanup

This commit is contained in:
Dallin Romney 2024-11-14 17:14:07 -08:00
parent 2bb2e65575
commit 77aa657d8b
2 changed files with 4 additions and 13 deletions

View file

@ -727,7 +727,7 @@ export class Core {
}
private indexingCancellationController: AbortController | undefined;
private async sendIndexingTelemetry(update: IndexingProgressUpdate) {
private async sendIndexingErrorTelemetry(update: IndexingProgressUpdate) {
console.debug(
"Indexing failed with error: ",
update.desc,
@ -763,11 +763,12 @@ export class Core {
this.indexingState = updateToSend;
if (update.status === "failed") {
void this.sendIndexingTelemetry(update);
void this.sendIndexingErrorTelemetry(update);
}
}
this.messenger.send("refreshSubmenuItems", undefined);
this.indexingCancellationController = undefined;
}
private async refreshCodebaseIndexFiles(files: string[]) {
@ -784,7 +785,6 @@ export class Core {
this.indexingCancellationController = new AbortController();
for await (const update of (await this.codebaseIndexerPromise).refreshFiles(
files,
this.indexingCancellationController.signal,
)) {
let updateToSend = { ...update };
if (update.status === "failed") {
@ -797,7 +797,7 @@ export class Core {
this.indexingState = updateToSend;
if (update.status === "failed") {
void this.sendIndexingTelemetry(update);
void this.sendIndexingErrorTelemetry(update);
}
}

View file

@ -147,7 +147,6 @@ export class CodebaseIndexer {
async *refreshFiles(
files: string[],
abortSignal: AbortSignal,
): AsyncGenerator<IndexingProgressUpdate> {
let progress = 0;
if (files.length === 0) {
@ -173,14 +172,6 @@ export class CodebaseIndexer {
if (this.pauseToken.paused) {
yield* this.yieldUpdateAndPause();
}
if (abortSignal.aborted) {
yield {
progress: 1,
desc: "Indexing cancelled",
status: "disabled",
};
return;
}
}
yield {