From 852a16d01b1b807eeec97c3baee7a53683a82038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sat, 8 Mar 2025 23:34:37 +0100 Subject: [PATCH] Remove leftovers --- .../Modules/Functions/Workers/Builds.php | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 0dcb27a950..0e16a0040e 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -671,16 +671,11 @@ class Builds extends Action } }), ]); - - \var_dump("Finish"); if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { Console::info('Build has been canceled'); return; } - - \var_dump("Problem"); - \var_dump($err); if ($err) { throw $err; @@ -691,15 +686,10 @@ class Builds extends Action $buildSizeLimit = (int)System::getEnv('_APP_COMPUTE_BUILD_SIZE_LIMIT', '2000000000'); if ($response['size'] > $buildSizeLimit) { - \var_dump("Limit issue"); throw new \Exception('Build size should be less than ' . number_format($buildSizeLimit / 1048576, 2) . ' MBs.'); } - \var_dump($resource->getCollection() === 'sites'); - \var_dump($resource->getAttribute('adapter', '')); if ($resource->getCollection() === 'sites' && empty($resource->getAttribute('adapter', ''))) { - \var_dump($resource->getAttribute('outputDirectory', './')); - \var_dump(\escapeshellarg($resource->getAttribute('outputDirectory', './'))); // TODO: Refactor with structured command in future, using utopia library (CLI) $listFilesCommand = "cd /usr/local/build && cd " . \escapeshellarg($resource->getAttribute('outputDirectory', './')) . " && find . -name 'node_modules' -prune -o -type f -print"; $command = $executor->createCommand( @@ -708,31 +698,21 @@ class Builds extends Action command: $listFilesCommand, timeout: 15 ); - - \var_dump($command); - + $files = \explode("\n", $command['output']); // Parse output $files = \array_filter($files); // Remove empty $files = \array_map(fn ($file) => \trim($file), $files); // Remove whitepsaces $files = \array_map(fn ($file) => \str_starts_with($file, './') ? \substr($file, 2) : $file, $files); // Remove beginning ./ - - \var_dump($files); $detector = new Rendering($files, $resource->getAttribute('framework', '')); $detector ->addOption(new SSR()) ->addOption(new XStatic()); $detection = $detector->detect(); - - \var_dump($detection->getName()); - \var_dump($detection->getFallbackFile()); - + $resource->setAttribute('adapter', $detection->getName()); $resource->setAttribute('fallbackFile', $detection->getFallbackFile() ?? ''); $resource = $dbForProject->updateDocument('sites', $resource->getId(), $resource); - - \var_dump("Updated"); - \var_dump($resource->getAttribute('fallbackFile', '')); } $executor->deleteRuntime($project->getId(), $deployment->getId(), '-build');