MSIN-4574 — Enhance ChronoTrack API synchronization by implementing retry logic for HTTP requests, adjusting batch sizes for entries, and improving error handling. Update version code to 4.72.974 to reflect these changes.

This commit is contained in:
2026-08-11 12:17:14 -04:00
parent d206a00015
commit c0f9d9712b
6 changed files with 580 additions and 154 deletions

View File

@ -212,7 +212,7 @@ switch ($strAction) {
$tabRetour = array('state' => 'error', 'message' => 'eve_id manquant');
break;
}
set_time_limit(300);
set_time_limit(180);
$intOffset = max(0, intval($_REQUEST['offset'] ?? 0));
$intLimit = max(0, intval($_REQUEST['limit'] ?? 0));
if ($intLimit <= 0) {
@ -231,12 +231,35 @@ switch ($strAction) {
}
break;
case 'sync_orphans':
case 'sync_push_bibs':
// MSIN-4574 — passe dossards découpée (évite 503 hébergeur en fin de resync)
if ($intEveId <= 0) {
$tabRetour = array('state' => 'error', 'message' => 'eve_id manquant');
break;
}
set_time_limit(180);
$intLimit = max(0, intval($_REQUEST['limit'] ?? 0));
if ($intLimit <= 0) {
$intLimit = MSIN_API_CHRONOTRACK_SYNC_BIB_CHUNK_SIZE;
}
try {
$tabRetour = fxChronotrackApiSyncPushBibsPhase($intEveId, array(
'limit' => $intLimit,
));
} catch (Throwable $e) {
$tabRetour = array(
'state' => 'error',
'message' => 'Exception dossards : ' . $e->getMessage(),
);
}
break;
case 'sync_orphans':
if ($intEveId <= 0) {
$tabRetour = array('state' => 'error', 'message' => 'eve_id manquant');
break;
}
set_time_limit(240);
$tabRetour = fxChronotrackApiSyncListCtOrphans($intEveId);
break;