From 7160f503220a1330f279f203e0965c70893f0672 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 24 Aug 2023 20:51:14 +0200 Subject: [PATCH] update autoupdate job --- app/Actions/Server/UpdateCoolify.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Actions/Server/UpdateCoolify.php b/app/Actions/Server/UpdateCoolify.php index 08740a8ed..f1d0c44fd 100644 --- a/app/Actions/Server/UpdateCoolify.php +++ b/app/Actions/Server/UpdateCoolify.php @@ -29,23 +29,21 @@ class UpdateCoolify $this->update(); } else { if (!$settings->is_auto_update_enabled) { - throw new \Exception('Auto update is disabled'); + return 'Auto update is disabled'; } if ($this->latest_version === $this->current_version) { - throw new \Exception('Already on latest version'); + return 'Already on latest version'; } if (version_compare($this->latest_version, $this->current_version, '<')) { - throw new \Exception('Latest version is lower than current version?!'); + return 'Latest version is lower than current version?!'; } $this->update(); } send_internal_notification('InstanceAutoUpdateJob done on: ' . $this->server->ip . "(fqdn:{$this->server->fqdn})" . ' to version: ' . $this->latest_version . ' from version: ' . $this->current_version); - return; } catch (\Exception $th) { ray('InstanceAutoUpdateJob failed'); ray($th->getMessage()); send_internal_notification('InstanceAutoUpdateJob failed: ' . $th->getMessage()); - return; } }