fix(csf): retry con backoff, delays entre tenants, timeouts aumentados

This commit is contained in:
Horux Dev
2026-06-01 23:43:43 +00:00
parent 44144ebf9d
commit bd7e499ab7
3 changed files with 73 additions and 62 deletions

View File

@@ -351,6 +351,8 @@ async function runCsfJob(): Promise<void> {
console.error(`[CSF Cron] Error para ${tenant.rfc}:`, error.message);
failed++;
}
// Delay entre tenants para no saturar al SAT y reducir bloqueos por IP
await new Promise(r => setTimeout(r, 30_000));
}
console.log(`[CSF Cron] Completado — éxito: ${success}, fallidos: ${failed}, sin FIEL: ${skipped}`);
}