Refactor upgrade method in Upgrade.php

This commit is contained in:
Andras Bacsai 2024-04-08 09:36:24 +02:00
parent 1f4440bcf9
commit 82372ea252

View File

@ -32,10 +32,10 @@ class Upgrade extends Component
public function upgrade() public function upgrade()
{ {
try { try {
$this->rateLimit(1, 30);
if ($this->showProgress) { if ($this->showProgress) {
return; return;
} }
$this->rateLimit(1, 30);
$this->showProgress = true; $this->showProgress = true;
UpdateCoolify::run(force: true, async: true); UpdateCoolify::run(force: true, async: true);
$this->dispatch('success', "Updating Coolify to {$this->latestVersion} version..."); $this->dispatch('success', "Updating Coolify to {$this->latestVersion} version...");