File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/Appwrite/Platform/Modules/Functions/Workers Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1218,13 +1218,22 @@ protected function buildDeployment(
12181218 $ message .= "\n[31m " . $ error ;
12191219 }
12201220
1221+ // Combine with previous logs if deployment got past build process
1222+ $ previousLogs = '' ;
1223+ if (!empty ($ deployment ->getAttribute ('buildEndedAt ' , '' ))) {
1224+ $ previousLogs = $ deployment ->getAttribute ('buildLogs ' , '' );
1225+ if (!empty ($ previousLogs )) {
1226+ $ message = $ previousLogs . "\n" . $ message ;
1227+ }
1228+ }
1229+
12211230 $ endTime = DateTime::now ();
12221231 $ durationEnd = \microtime (true );
12231232 $ deployment ->setAttribute ('buildEndedAt ' , $ endTime );
12241233 $ deployment ->setAttribute ('buildDuration ' , \intval (\ceil ($ durationEnd - $ durationStart )));
12251234 $ deployment ->setAttribute ('status ' , 'failed ' );
1226- $ deployment ->setAttribute ('buildLogs ' , $ deployment ->getAttribute ('buildLogs ' , '' ) . "\n" . $ message );
12271235
1236+ $ deployment ->setAttribute ('buildLogs ' , $ message );
12281237 $ deployment = $ dbForProject ->updateDocument ('deployments ' , $ deploymentId , $ deployment );
12291238
12301239 if ($ deployment ->getInternalId () === $ resource ->getAttribute ('latestDeploymentInternalId ' , '' )) {
You can’t perform that action at this time.
0 commit comments