From 3e5dc86b4feb4a6ae7bf71c2ce702c42917f5558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 19 Oct 2022 11:23:03 +0000 Subject: [PATCH] Linter fix --- app/executor.php | 6 +++--- src/FunctionsProxy/Adapter/RoundRobin.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/executor.php b/app/executor.php index 3d7b7cfe45..cdc40d8a7d 100644 --- a/app/executor.php +++ b/app/executor.php @@ -775,17 +775,17 @@ $http->on('start', function ($http) { // Get usage stats of host machine CPU usage from 0 to 100. $healthServer->handle('/v1/health', function (SwooleRequest $swooleRequest, SwooleResponse $swooleResponse) use ($orchestrationPool) { $orchestration = null; - + try { $secretKey = $swooleRequest->header['x-appwrite-executor-key'] ?? ''; if (empty($secretKey)) { throw new Exception('Missing executor key', 401); } - + if ($secretKey !== App::getEnv('_APP_EXECUTOR_SECRET', '')) { throw new Exception('Missing executor key', 401); } - + $output = [ 'status' => 'pass' diff --git a/src/FunctionsProxy/Adapter/RoundRobin.php b/src/FunctionsProxy/Adapter/RoundRobin.php index fa30c34bc6..d8e7d44d7b 100644 --- a/src/FunctionsProxy/Adapter/RoundRobin.php +++ b/src/FunctionsProxy/Adapter/RoundRobin.php @@ -10,7 +10,7 @@ class RoundRobin extends Adapter { private Atomic $counter; - function __construct(RedisPool $redisPool) + public function __construct(RedisPool $redisPool) { parent::__construct($redisPool); $this->counter = new Atomic(-1); @@ -22,7 +22,7 @@ class RoundRobin extends Adapter $executors = $this->getExecutors(); $executor = $executors[$index] ?? null; - if(!$executor) { + if (!$executor) { $executor = $executors[0]; $this->counter->cmpset($index, 0); }