Fixes timed prompts generation race condition
Reorders initialization of in-progress flag to prevent potential race conditions during timed prompt generation Ensures that the in-progress status is set before stopping existing sequences and generates prompts
This commit is contained in:
1 file changed
+3
-1
@@ -21,11 +21,13 @@ export class TimedPromptsCommand {
|
|||||||
new Notice('Timed prompts are already being generated. Please wait.');
|
new Notice('Timed prompts are already being generated. Please wait.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.inProgress = true;
|
||||||
|
|
||||||
// Stop any existing timed sequence
|
// Stop any existing timed sequence
|
||||||
this.stop();
|
this.stop();
|
||||||
|
|
||||||
this.inProgress = true;
|
|
||||||
try {
|
try {
|
||||||
// Generate prompts
|
// Generate prompts
|
||||||
const prompts = await this.promptGenerator.generateTimedPrompts(settings);
|
const prompts = await this.promptGenerator.generateTimedPrompts(settings);
|
||||||
|
|||||||
Reference in new issue
Block a user