Merge branch 'next' of github.com:coollabsio/coolify into next
This commit is contained in:
commit
73a265107a
4 changed files with 13 additions and 10 deletions
|
|
@ -77,11 +77,11 @@ private function scheduleUpdates($schedule)
|
|||
$settings = InstanceSettings::get();
|
||||
|
||||
$updateCheckFrequency = $settings->update_check_frequency ?? '0 0 * * *';
|
||||
$schedule->job(new CheckForUpdatesJob())->cron($updateCheckFrequency)->onOneServer();
|
||||
$schedule->job(new CheckForUpdatesJob)->cron($updateCheckFrequency)->onOneServer();
|
||||
|
||||
if ($settings->is_auto_update_enabled) {
|
||||
$autoUpdateFrequency = $settings->auto_update_frequency ?? '0 11,23 * * *';
|
||||
$schedule->job(new UpdateCoolifyJob())->cron($autoUpdateFrequency)->onOneServer();
|
||||
$schedule->job(new UpdateCoolifyJob)->cron($autoUpdateFrequency)->onOneServer();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,4 +41,4 @@ public function handle(): void
|
|||
// Consider implementing a notification to administrators
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,4 +47,4 @@ public function handle(): void
|
|||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Actions\Server\UpdateCoolify;
|
||||
use App\Models\InstanceSettings;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Bus\Queueable;
|
||||
|
|
@ -10,7 +11,6 @@
|
|||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Actions\Server\UpdateCoolify;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UpdateCoolifyJob implements ShouldBeEncrypted, ShouldQueue
|
||||
|
|
@ -23,19 +23,22 @@ public function handle(): void
|
|||
{
|
||||
try {
|
||||
$settings = InstanceSettings::get();
|
||||
if (!$settings->is_auto_update_enabled) {
|
||||
if (! $settings->is_auto_update_enabled) {
|
||||
Log::info('Auto-update is disabled. Skipping update check.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$settings->new_version_available) {
|
||||
if (! $settings->new_version_available) {
|
||||
Log::info('No new version available. Skipping update.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$server = Server::findOrFail(0);
|
||||
if (!$server) {
|
||||
if (! $server) {
|
||||
Log::error('Server not found. Cannot proceed with update.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -46,8 +49,8 @@ public function handle(): void
|
|||
Log::info('Coolify update completed successfully.');
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('UpdateCoolifyJob failed: ' . $e->getMessage());
|
||||
Log::error('UpdateCoolifyJob failed: '.$e->getMessage());
|
||||
// Consider implementing a notification to administrators
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue