From 7fb3df3b38e3acb995ea08f3a1d2614547680b2a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 18 Feb 2022 13:21:59 +0400 Subject: [PATCH] feat: cleanup --- app/executor.php | 5 ----- src/Executor/Executor.php | 17 ----------------- 2 files changed, 22 deletions(-) diff --git a/app/executor.php b/app/executor.php index af68fb30ad..b64b4b0761 100644 --- a/app/executor.php +++ b/app/executor.php @@ -197,11 +197,6 @@ App::post('/v1/runtimes') 'openruntimes-created' => strval($buildStart), 'openruntimes-runtime' => $runtime, ], - // command: [ - // 'tail', - // '-f', - // '/dev/null' - // ], mountFolder: \dirname($tmpSource), workdir: $workdir, volumes: [ diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 5ca0f4a706..c1f7694312 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -3,7 +3,6 @@ namespace Executor; use Exception; -use phpDocumentor\Reflection\DocBlock\Tags\Var_; use Utopia\App; use Utopia\CLI\Console; @@ -110,18 +109,6 @@ class Executor $timeout ) { - // - 1st request - // - POST /execution - // - 404 - runtime not found - // - POST /runtimes - 200 - // - POST /execution - - // - 2nd request - // - POST /execution - // - 425 - runtime is not ready - // - Retries x 3 + 100ms wait - // - POST /execution - // - if failes anyway - throw and 4xx/5xx error $route = "/execution"; $headers = [ 'content-type' => 'application/json', @@ -145,7 +132,6 @@ class Executor for ($attempts = 0; $attempts < 3; $attempts++) { switch ($status) { case 404: - Console::error("Runtime not found. Creating runtine"); $response = $this->createRuntime( functionId: $functionId, deploymentId: $deploymentId, @@ -156,11 +142,8 @@ class Executor vars: $vars, commands: [] ); - /** Try to create the execution once more */ - Console::error("Creating execution"); $response = $this->call(self::METHOD_POST, $route, $headers, $params, true, 30); $status = $response['headers']['status-code']; - var_dump($status); break; case 406: $response = $this->call(self::METHOD_POST, $route, $headers, $params, true, 30);