fix: remove sentinel variable

fix: metrics are disabled by default
This commit is contained in:
Andras Bacsai
2024-06-18 13:01:23 +02:00
parent 768c917a0e
commit 83983bbb32
5 changed files with 36 additions and 7 deletions

View File

@@ -61,7 +61,7 @@ class Kernel extends ConsoleKernel
{
$servers = $this->all_servers->where('settings.is_usable', true)->where('settings.is_reachable', true)->where('ip', '!=', '1.2.3.4');
foreach ($servers as $server) {
if (config('coolify.is_sentinel_enabled')) {
if ($server->is_metrics_enabled) {
$schedule->job(new PullSentinelImageJob($server))->everyFiveMinutes()->onOneServer();
}
$schedule->job(new PullHelperImageJob($server))->everyFiveMinutes()->onOneServer();

View File

@@ -50,7 +50,6 @@ class PullSentinelImageJob implements ShouldBeEncrypted, ShouldQueue
}
if (version_compare($local_version, $version, '<')) {
StartSentinel::run($this->server, $version, true);
return;
}
ray('Sentinel image is up to date');

View File

@@ -41,19 +41,19 @@ class ServerStatusJob implements ShouldBeEncrypted, ShouldQueue
public function handle()
{
if (! $this->server->isServerReady($this->tries)) {
if (!$this->server->isServerReady($this->tries)) {
throw new \RuntimeException('Server is not ready.');
}
try {
if ($this->server->isFunctional()) {
$this->cleanup(notify: false);
$this->remove_unnecessary_coolify_yaml();
if (config('coolify.is_sentinel_enabled')) {
if ($this->server->is_metrics_enabled) {
$this->server->checkSentinel();
}
}
} catch (\Throwable $e) {
send_internal_notification('ServerStatusJob failed with: '.$e->getMessage());
send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage());
ray($e->getMessage());
return handleError($e);
@@ -103,7 +103,7 @@ class ServerStatusJob implements ShouldBeEncrypted, ShouldQueue
{
// 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';
$file = $this->server->proxyPath() . '/dynamic/coolify.yaml';
return instant_remote_process([
"rm -f $file",