fix: race condition on disabled indexing
This commit is contained in:
parent
02465b6528
commit
1f7a93e2af
1 changed files with 12 additions and 1 deletions
13
core/core.ts
13
core/core.ts
|
|
@ -17,8 +17,8 @@ import { DataLogger } from "./data/log";
|
|||
import { CodebaseIndexer } from "./indexing/CodebaseIndexer";
|
||||
import DocsService from "./indexing/docs/DocsService";
|
||||
import { countTokens } from "./llm/countTokens";
|
||||
import Ollama from "./llm/llms/Ollama";
|
||||
import Lemonade from "./llm/llms/Lemonade";
|
||||
import Ollama from "./llm/llms/Ollama";
|
||||
import { EditAggregator } from "./nextEdit/context/aggregateEdits";
|
||||
import { createNewPromptFileV2 } from "./promptFiles/createNewPromptFile";
|
||||
import { callTool } from "./tools/callTool";
|
||||
|
|
@ -232,6 +232,17 @@ export class Core {
|
|||
return;
|
||||
}
|
||||
|
||||
// Check for disableIndexing to prevent race condition
|
||||
const { config } = await this.configHandler.loadConfig();
|
||||
if (!config || config.disableIndexing) {
|
||||
void this.messenger.request("indexProgress", {
|
||||
progress: 0,
|
||||
desc: "Indexing is disabled",
|
||||
status: "disabled",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
void this.codeBaseIndexer.refreshCodebaseIndex(dirs);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue