Skip to content

Commit 1f7a93e

Browse files
fix: race condition on disabled indexing
1 parent 02465b6 commit 1f7a93e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

core/core.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import { DataLogger } from "./data/log";
1717
import { CodebaseIndexer } from "./indexing/CodebaseIndexer";
1818
import DocsService from "./indexing/docs/DocsService";
1919
import { countTokens } from "./llm/countTokens";
20-
import Ollama from "./llm/llms/Ollama";
2120
import Lemonade from "./llm/llms/Lemonade";
21+
import Ollama from "./llm/llms/Ollama";
2222
import { EditAggregator } from "./nextEdit/context/aggregateEdits";
2323
import { createNewPromptFileV2 } from "./promptFiles/createNewPromptFile";
2424
import { callTool } from "./tools/callTool";
@@ -232,6 +232,17 @@ export class Core {
232232
return;
233233
}
234234

235+
// Check for disableIndexing to prevent race condition
236+
const { config } = await this.configHandler.loadConfig();
237+
if (!config || config.disableIndexing) {
238+
void this.messenger.request("indexProgress", {
239+
progress: 0,
240+
desc: "Indexing is disabled",
241+
status: "disabled",
242+
});
243+
return;
244+
}
245+
235246
void this.codeBaseIndexer.refreshCodebaseIndex(dirs);
236247
});
237248
});

0 commit comments

Comments
 (0)