Skip to content

Commit 889d31a

Browse files
author
Miriad
committed
fix: completion divisor matches orientation multiplier
completedPrompts was always dividing by 2 (assuming both orientations). In vertical-only mode (enableHorizontalInfographics=false), this caused the batch loop to never reach completion — generating 2x the intended images. Now reads the config to use divisor=1 for vertical-only.
1 parent b6c94c5 commit 889d31a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/api/cron/check-research/route.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ async function stepInfographicsGenerating(
314314
}
315315

316316
// Determine which prompts to process this cycle
317-
const completedPrompts = Math.floor(progress.completed / 2); // each prompt = 2 images
317+
// Divisor matches multiplier from stepResearchComplete: 2 for both orientations, 1 for vertical-only
318+
const enableHorizontalForCompletion = await getConfigValue('pipeline_config', 'enableHorizontalInfographics', false);
319+
const divisor = enableHorizontalForCompletion ? 2 : 1;
320+
const completedPrompts = Math.floor(progress.completed / divisor);
318321
const useScenePrompts = sceneImagePrompts.length > 0;
319322

320323
let batchPrompts: string[];

0 commit comments

Comments
 (0)