onQueue('high'); } public function handle(): void { try { CheckForUpdatesJob::dispatchSync(); $settings = instanceSettings(); if (! $settings->new_version_available) { Log::info('No new version available. Skipping update.'); return; } $server = Server::findOrFail(0); if (! $server) { Log::error('Server not found. Cannot proceed with update.'); return; } Log::info('Starting Coolify update process...'); UpdateCoolify::run(false); // false means it's not a manual update Log::info('Coolify upgrade script started. Result: /data/coolify/source/.upgrade-status, log: /data/coolify/source/upgrade-*.log.'); } catch (\Throwable $e) { Log::error('UpdateCoolifyJob failed: '.$e->getMessage()); // Consider implementing a notification to administrators } } }