diff --git a/app/Actions/Server/UpdateCoolify.php b/app/Actions/Server/UpdateCoolify.php index 04bfbac06..16a01fb6f 100644 --- a/app/Actions/Server/UpdateCoolify.php +++ b/app/Actions/Server/UpdateCoolify.php @@ -14,7 +14,7 @@ class UpdateCoolify public ?string $latestVersion = null; public ?string $currentVersion = null; - public function handle() + public function handle($manual_update = false) { try { $settings = InstanceSettings::get(); @@ -26,17 +26,19 @@ class UpdateCoolify CleanupDocker::run($this->server, false); $this->latestVersion = get_latest_version_of_coolify(); $this->currentVersion = config('version'); - if (!$settings->is_auto_update_enabled) { - Log::info('Auto update is disabled'); - throw new \Exception('Auto update is disabled'); - } - if ($this->latestVersion === $this->currentVersion) { - Log::info('Already on latest version'); - throw new \Exception('Already on latest version'); - } - if (version_compare($this->latestVersion, $this->currentVersion, '<')) { - Log::info('Latest version is lower than current version?!'); - throw new \Exception('Latest version is lower than current version?!'); + if (!$manual_update) { + if (!$settings->is_auto_update_enabled) { + Log::debug('Auto update is disabled'); + return; + } + if ($this->latestVersion === $this->currentVersion) { + Log::debug('Already on latest version'); + return; + } + if (version_compare($this->latestVersion, $this->currentVersion, '<')) { + Log::debug('Latest version is lower than current version?!'); + return; + } } Log::info("Updating from {$this->currentVersion} -> {$this->latestVersion}"); $this->update(); @@ -52,7 +54,7 @@ class UpdateCoolify { if (isDev()) { instant_remote_process([ - "sleep 10" + "sleep 1" ], $this->server); return; } diff --git a/app/Livewire/Upgrade.php b/app/Livewire/Upgrade.php index ba9fad7fd..e81ee93e6 100644 --- a/app/Livewire/Upgrade.php +++ b/app/Livewire/Upgrade.php @@ -5,11 +5,9 @@ namespace App\Livewire; use App\Actions\Server\UpdateCoolify; use Livewire\Component; -use DanHarrin\LivewireRateLimiting\WithRateLimiting; class Upgrade extends Component { - use WithRateLimiting; public bool $showProgress = false; public bool $updateInProgress = false; public bool $isUpgradeAvailable = false; @@ -31,9 +29,8 @@ class Upgrade extends Component if ($this->updateInProgress) { return; } - $this->rateLimit(1, 60); $this->updateInProgress = true; - UpdateCoolify::run(); + UpdateCoolify::run(manual_update: true); } catch (\Throwable $e) { return handleError($e, $this); } diff --git a/config/sentry.php b/config/sentry.php index e4861e285..744642dae 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ return [ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.291', + 'release' => '4.0.0-beta.292', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index 2d27ac881..c7756dc4f 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@