Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net
$tmpBuild = "/{$tmpFolder}builds/code.tar.gz";
$tmpLogging = "/{$tmpFolder}logging"; // Build logs
$tmpLogs = "/{$tmpFolder}logs"; // Runtime logs
$tmpBuildOutput = "/{$tmpFolder}buildOutput"; // Build output

$sourceDevice = getStorageDevice("/");
$localDevice = new Local();
Expand Down Expand Up @@ -704,6 +705,7 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net
if ($version === 'v5') {
$volumes[] = \dirname($tmpLogs . '/logs') . ':/mnt/logs:rw';
$volumes[] = \dirname($tmpLogging . '/logging') . ':/tmp/logging:rw';
$volumes[] = \dirname($tmpBuildOutput) . ':/usr/local/build:rw';
}

/** Keep the container alive if we have commands to be executed */
Expand Down Expand Up @@ -766,6 +768,10 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net
];
}
} catch (Throwable $err) {
if ($version !== 'v2') {
$output = Logs::get($runtimeName);
}

throw new Exception($err->getMessage(), 400);
}
}
Expand Down Expand Up @@ -833,12 +839,6 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net
'timestamp' => Logs::getTimestamp(),
'content' => $message
];
} else {
$output = Logs::get($runtimeName);
$output = \count($output) > 0 ? $output : [
'timestamp' => Logs::getTimestamp(),
'content' => $th->getMessage()
];
}

$localDevice->deletePath($tmpFolder);
Expand Down
Loading