fix: reduce bulk summary batch to 5 per request

The previous batch size of 50 exceeded PHP max_execution_time on
Hostinger shared hosting (30s). Each article needs ~3s for the
OpenRouter API call, so 5 articles per AJAX request keeps each
batch under 20s. The JS loop still processes all articles
automatically — just in more, smaller batches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Terence Ong
2026-04-07 15:04:16 +07:00
parent ab56ec7e97
commit 245b24b854
2 changed files with 8 additions and 8 deletions

View File

@@ -411,10 +411,10 @@ class Peptide_News_LLM {
) ); ) );
} }
// Process a generous batch — the 120-second timeout guard inside // Process a small batch per request to stay within PHP's
// process_unanalyzed() will stop early if needed. Override the // max_execution_time (often 30s on shared hosting). The JS UI
// per-cycle limit since this is a manual admin action. // loops automatically until all articles are done.
$batch_size = min( 50, $remaining ); $batch_size = min( 5, $remaining );
$processed = self::process_unanalyzed( $batch_size, true ); $processed = self::process_unanalyzed( $batch_size, true );
// Recount remaining after this batch. // Recount remaining after this batch.

View File

@@ -411,10 +411,10 @@ class Peptide_News_LLM {
) ); ) );
} }
// Process a generous batch — the 120-second timeout guard inside // Process a small batch per request to stay within PHP's
// process_unanalyzed() will stop early if needed. Override the // max_execution_time (often 30s on shared hosting). The JS UI
// per-cycle limit since this is a manual admin action. // loops automatically until all articles are done.
$batch_size = min( 50, $remaining ); $batch_size = min( 5, $remaining );
$processed = self::process_unanalyzed( $batch_size, true ); $processed = self::process_unanalyzed( $batch_size, true );
// Recount remaining after this batch. // Recount remaining after this batch.