From ba86a75c4fb808ae4b969cb58bf303f9d32b2ddf Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 25 Oct 2024 11:41:29 +0200 Subject: [PATCH] Refactor ServerStatusJob to remove unnecessary coolify.yaml file --- app/Jobs/ServerStatusJob.php | 60 ------------------------------------ 1 file changed, 60 deletions(-) delete mode 100644 app/Jobs/ServerStatusJob.php diff --git a/app/Jobs/ServerStatusJob.php b/app/Jobs/ServerStatusJob.php deleted file mode 100644 index fcc33c859..000000000 --- a/app/Jobs/ServerStatusJob.php +++ /dev/null @@ -1,60 +0,0 @@ -server->isServerReady($this->tries)) { - throw new \RuntimeException('Server is not ready.'); - } - try { - if ($this->server->isFunctional()) { - $this->remove_unnecessary_coolify_yaml(); - if ($this->server->isSentinelEnabled()) { - $this->server->checkSentinel(); - } - } - } catch (\Throwable $e) { - // send_internal_notification('ServerStatusJob failed with: '.$e->getMessage()); - ray($e->getMessage()); - - return handleError($e); - } - - } - - private function remove_unnecessary_coolify_yaml() - { - // This will remote the coolify.yaml file from the server as it is not needed on cloud servers - if (isCloud() && $this->server->id !== 0) { - $file = $this->server->proxyPath().'/dynamic/coolify.yaml'; - - return instant_remote_process([ - "rm -f $file", - ], $this->server, false); - } - } -}