Skip to content

Commit

Permalink
Merge pull request #41 from open-runtimes/feat-chunk-builds
Browse files Browse the repository at this point in the history
Feat: chunk storage read/writes
  • Loading branch information
christyjacob4 authored Sep 20, 2023
2 parents f86f1a0 + bcafcd3 commit c4d9229
Showing 1 changed file with 2 additions and 4 deletions.
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

0 comments on commit c4d9229

Please sign in to comment.