mirror of
https://github.com/appwrite/appwrite
synced 2026-05-19 23:18:40 +00:00
Fix ssr separation; add edge debugging logs
This commit is contained in:
parent
5dcc508870
commit
b5bc240c0d
1 changed files with 15 additions and 9 deletions
|
|
@ -747,6 +747,13 @@ class Builds extends Action
|
|||
if ($separator !== false) {
|
||||
$logs = \substr($logs, 0, $separator);
|
||||
$insideSeparation = true;
|
||||
|
||||
$leftover = \substr($logs, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_START}'));
|
||||
$separator = \strpos($leftover, '{APPWRITE_DETECTION_SEPARATOR_END}');
|
||||
if ($separator !== false) {
|
||||
$logs .= \substr($leftover, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_END}'));
|
||||
$insideSeparation = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$separator = \strpos($logs, '{APPWRITE_DETECTION_SEPARATOR_END}');
|
||||
|
|
@ -836,11 +843,10 @@ class Builds extends Action
|
|||
|
||||
// Separate logs for SSR detection
|
||||
$detectionLogs = '';
|
||||
$separator = \strpos($logs, '{APPWRITE_DETECTION_SEPARATOR_START}');
|
||||
if ($separator !== false) {
|
||||
if (\str_contains($logs, '{APPWRITE_DETECTION_SEPARATOR_START}')) {
|
||||
[$logsBefore, $detectionLogsStart] = \explode('{APPWRITE_DETECTION_SEPARATOR_START}', $logs, 2);
|
||||
[$detectionLogs, $logsAfter] = \explode('{APPWRITE_DETECTION_SEPARATOR_END}', $detectionLogsStart, 2);
|
||||
$logs = $logsBefore . $logsAfter;
|
||||
$logs = ($logsBefore ?? '') . ($logsAfter ?? '');
|
||||
}
|
||||
|
||||
$deployment->setAttribute('buildLogs', $logs);
|
||||
|
|
@ -877,6 +883,10 @@ class Builds extends Action
|
|||
|
||||
$this->afterBuildSuccess($queueForRealtime, $dbForProject, $deployment);
|
||||
|
||||
\var_dump("After edge finish:");
|
||||
\var_dump($deployment);
|
||||
\var_dump('---');
|
||||
|
||||
if ($resource->getCollection() === 'sites') {
|
||||
$date = \date('H:i:s');
|
||||
$logs .= "[90m[$date] [90m[[0mappwrite[90m][97m Screenshot capturing started. [0m\n";
|
||||
|
|
@ -1225,12 +1235,8 @@ class Builds extends Action
|
|||
$message = "[31m" . $message;
|
||||
}
|
||||
|
||||
$separator = \strpos($message, '{APPWRITE_DETECTION_SEPARATOR_START}');
|
||||
if ($separator !== false) {
|
||||
$error = \substr($message, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_START}'));
|
||||
$message = \substr($message, 0, $separator);
|
||||
$message .= "\n[31m" . $error;
|
||||
}
|
||||
$message = \str_replace('{APPWRITE_DETECTION_SEPARATOR_START}', '', $message, 1);
|
||||
$message = \str_replace('{APPWRITE_DETECTION_SEPARATOR_END}', '', $message, 1);
|
||||
|
||||
// Combine with previous logs if deployment got past build process
|
||||
$previousLogs = '';
|
||||
|
|
|
|||
Loading…
Reference in a new issue