Fix logs parsing

This commit is contained in:
Matej Bačo 2025-06-24 15:38:39 +02:00
parent 6996cc28a0
commit 5dcc508870

View file

@ -838,11 +838,9 @@ class Builds extends Action
$detectionLogs = '';
$separator = \strpos($logs, '{APPWRITE_DETECTION_SEPARATOR_START}');
if ($separator !== false) {
$detectionLogs = \substr($logs, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR}'));
$separatorEnd = \strpos($detectionLogs, '{APPWRITE_DETECTION_SEPARATOR_END}');
$logs .= \substr($detectionLogs, $separatorEnd + strlen('{APPWRITE_DETECTION_SEPARATOR_END}'));
$detectionLogs = \substr($detectionLogs, 0, $separatorEnd);
$logs = \substr($logs, 0, $separator);
[$logsBefore, $detectionLogsStart] = \explode('{APPWRITE_DETECTION_SEPARATOR_START}', $logs, 2);
[$detectionLogs, $logsAfter] = \explode('{APPWRITE_DETECTION_SEPARATOR_END}', $detectionLogsStart, 2);
$logs = $logsBefore . $logsAfter;
}
$deployment->setAttribute('buildLogs', $logs);
@ -877,7 +875,6 @@ class Builds extends Action
->setPayload($deployment->getArrayCopy())
->trigger();
$this->afterBuildSuccess($queueForRealtime, $dbForProject, $deployment);
if ($resource->getCollection() === 'sites') {