From 50ede5cab9105a956eed748a4d68d13356031c1f Mon Sep 17 00:00:00 2001 From: ayntk-ai <122374094+ayntk-ai@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:57:27 +0200 Subject: [PATCH] remove comments and remove duplicated scheduling --- app/Console/Kernel.php | 8 ++------ app/Livewire/Settings/Configuration.php | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 92a1b1618..735b75de1 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -45,10 +45,6 @@ class Kernel extends ConsoleKernel $schedule->command('cleanup:unreachable-servers')->daily(); $schedule->job(new PullTemplatesFromCDN)->daily()->onOneServer(); $schedule->job(new CleanupInstanceStuffsJob)->everyFiveMinutes()->onOneServer(); - $schedule->job(new PullCoolifyImageJob)->cron($settings->update_check_frequency ?? '0 0 * * *')->onOneServer(); - $schedule->job(new CheckForUpdatesJob())->cron($settings->auto_update_frequency ?? '0 11,23 * * *')->onOneServer(); - - // Server Jobs $this->scheduleUpdates($schedule); $this->pull_images($schedule); $this->check_resources($schedule); @@ -76,11 +72,11 @@ class Kernel extends ConsoleKernel { $settings = InstanceSettings::get(); - $updateCheckFrequency = $settings->update_check_frequency ?? '0 0 * * *'; // Default to daily at 00:00 + $updateCheckFrequency = $settings->update_check_frequency ?? '0 0 * * *'; $schedule->job(new CheckForUpdatesJob())->cron($updateCheckFrequency)->onOneServer(); if ($settings->is_auto_update_enabled) { - $autoUpdateFrequency = $settings->auto_update_frequency ?? '0 11,23 * * *'; // Default to twice daily at 11:00 and 23:00 + $autoUpdateFrequency = $settings->auto_update_frequency ?? '0 11,23 * * *'; $schedule->job(new UpdateCoolifyJob())->cron($autoUpdateFrequency)->onOneServer(); } } diff --git a/app/Livewire/Settings/Configuration.php b/app/Livewire/Settings/Configuration.php index 2f4c77535..60cd46907 100644 --- a/app/Livewire/Settings/Configuration.php +++ b/app/Livewire/Settings/Configuration.php @@ -91,7 +91,6 @@ class Configuration extends Component } $this->validate(); - // Allow empty values and set defaults if ($this->is_auto_update_enabled && !$this->validateCronExpression($this->auto_update_frequency)) { $this->dispatch('error', 'Invalid Cron / Human expression for Auto Update Frequency.'); return;