From db9a68e9c9374f540e8a36425310ecd5043cc62f Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 10 May 2024 09:21:19 +0200 Subject: [PATCH] make sentinel enabled env var --- app/Console/Kernel.php | 4 +++- app/Jobs/ServerStatusJob.php | 4 +++- config/coolify.php | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 9f834d3e0..89d679a47 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -58,7 +58,9 @@ private function pull_helper_image($schedule) { $servers = Server::all()->where('settings.is_usable', true)->where('settings.is_reachable', true)->where('ip', '!=', '1.2.3.4'); foreach ($servers as $server) { - // $schedule->job(new PullSentinelImageJob($server))->everyFiveMinutes()->onOneServer(); + if (config('coolify.is_sentinel_enabled')) { + $schedule->job(new PullSentinelImageJob($server))->everyFiveMinutes()->onOneServer(); + } $schedule->job(new PullHelperImageJob($server))->everyFiveMinutes()->onOneServer(); } } diff --git a/app/Jobs/ServerStatusJob.php b/app/Jobs/ServerStatusJob.php index 4ec28328f..449ab85a0 100644 --- a/app/Jobs/ServerStatusJob.php +++ b/app/Jobs/ServerStatusJob.php @@ -44,7 +44,9 @@ public function handle() if ($this->server->isFunctional()) { $this->cleanup(notify: false); $this->removeCoolifyYaml(); - // $this->server->checkSentinel(); + if (config('coolify.is_sentinel_enabled')) { + $this->server->checkSentinel(); + } } } catch (\Throwable $e) { send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage()); diff --git a/config/coolify.php b/config/coolify.php index a6d6d8581..c7cfe6101 100644 --- a/config/coolify.php +++ b/config/coolify.php @@ -14,4 +14,5 @@ 'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper:latest'), 'is_horizon_enabled' => env('HORIZON_ENABLED', true), 'is_scheduler_enabled' => env('SCHEDULER_ENABLED', true), + 'is_sentinel_enabled' => env('SENTINEL_ENABLED', false), ];