Skip to content
Merged
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
6 changes: 2 additions & 4 deletions app/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,7 @@ function removeAllRuntimes(Table $activeRuntimes, Orchestration $orchestration):
* Copy code files from source to a temporary location on the executor
*/
if (!empty($source)) {
$buffer = $sourceDevice->read($source);
if (!$localDevice->write($tmpSource, $buffer)) {
if (!$localDevice->transfer($source, $tmpSource, $sourceDevice)) {
throw new Exception('Failed to copy source code to temporary directory', 500);
};
}
Expand Down Expand Up @@ -537,9 +536,8 @@ function removeAllRuntimes(Table $activeRuntimes, Orchestration $orchestration):
$destinationDevice = getStorageDevice($destination);
$path = $destinationDevice->getPath(\uniqid() . '.' . \pathinfo('code.tar.gz', PATHINFO_EXTENSION));

$buffer = $localDevice->read($tmpBuild);

if (!$destinationDevice->write($path, $buffer, $localDevice->getFileMimeType($tmpBuild))) {
if (!$localDevice->transfer($tmpBuild, $path, $destinationDevice)) {
throw new Exception('Failed to move built code to storage', 500);
};

Expand Down