Update: 2026-05-08 14:29:22

This commit is contained in:
Hamza-Ayed
2026-05-08 14:29:22 +03:00
parent be0571648a
commit 9bfd394b26
4 changed files with 64 additions and 18 deletions

View File

@@ -57,6 +57,12 @@ $stmt = $db->prepare("
");
$stmt->execute([$batchId]);
// 3. If it's a single invoice, try triggering the worker in the background immediately
// This helps if the Cron Job is delayed or failing.
$workerPath = ROOT_PATH . '/app/cron/process_batches.php';
$logPath = STORAGE_PATH . '/logs/cron.log';
exec("php " . escapeshellarg($workerPath) . " >> " . escapeshellarg($logPath) . " 2>&1 &");
json_success([
'batch_id' => $batchId,
'status' => 'processing',