From 3df80f2653d06cbf279d4af17ea0d552a721c949 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 29 Apr 2024 09:57:46 +0200 Subject: [PATCH] fix: autoupdate --- app/Console/Kernel.php | 2 +- app/Jobs/InstanceAutoUpdateJob.php | 3 ++- scripts/upgrade.sh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 31760f2fd..734063b2e 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -83,7 +83,7 @@ private function check_resources($schedule) } private function instance_auto_update($schedule) { - if (isDev()) { + if (isDev() || isCloud()) { return; } $settings = InstanceSettings::get(); diff --git a/app/Jobs/InstanceAutoUpdateJob.php b/app/Jobs/InstanceAutoUpdateJob.php index fa5c29421..dc35aa2b1 100644 --- a/app/Jobs/InstanceAutoUpdateJob.php +++ b/app/Jobs/InstanceAutoUpdateJob.php @@ -15,7 +15,8 @@ class InstanceAutoUpdateJob implements ShouldQueue, ShouldBeUnique, ShouldBeEncr { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; - public $timeout = 120; + public $timeout = 600; + public $tries = 1; public function __construct(private bool $force = false) { diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index bb1112bd5..da5f84c28 100644 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -30,7 +30,7 @@ docker network create --attachable coolify 2>/dev/null if [ -f /data/coolify/source/docker-compose.custom.yml ]; then echo "docker-compose.custom.yml detected." - docker run --pull always -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock --rm ghcr.io/coollabsio/coolify-helper bash -c "LATEST_IMAGE=${1:-} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml -f /data/coolify/source/docker-compose.custom.yml up -d --pull always --remove-orphans --force-recreate" + docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock --rm ghcr.io/coollabsio/coolify-helper bash -c "LATEST_IMAGE=${1:-} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml -f /data/coolify/source/docker-compose.custom.yml up -d --pull always --remove-orphans --force-recreate" else - docker run --pull always -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock --rm ghcr.io/coollabsio/coolify-helper bash -c "LATEST_IMAGE=${1:-} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d --pull always --remove-orphans --force-recreate" + docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock --rm ghcr.io/coollabsio/coolify-helper bash -c "LATEST_IMAGE=${1:-} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d --pull always --remove-orphans --force-recreate" fi