remove debugs

This commit is contained in:
Andras Bacsai 2023-05-25 23:12:27 +02:00
parent ac424ce529
commit c97656d45e

View File

@ -21,7 +21,6 @@ class InstanceAutoUpdateJob implements ShouldQueue
public function __construct(private bool $force = false) public function __construct(private bool $force = false)
{ {
Log::info("InstanceAutoUpdateJob");
if (config('app.env') === 'local') { if (config('app.env') === 'local') {
$server_name = 'testing-local-docker-container'; $server_name = 'testing-local-docker-container';
} else { } else {
@ -32,14 +31,10 @@ class InstanceAutoUpdateJob implements ShouldQueue
throw new \Exception("Server not found"); throw new \Exception("Server not found");
} }
$this->server = $server; $this->server = $server;
$this->latest_version = get_latest_version_of_coolify(); $this->latest_version = get_latest_version_of_coolify();
$this->current_version = config('version'); $this->current_version = config('version');
Log::info("InstanceAutoUpdateJob: latest version is " . $this->latest_version);
Log::info("InstanceAutoUpdateJob: current version is " . $this->current_version);
if (!$this->force) { if (!$this->force) {
Log::info("InstanceAutoUpdateJob: force is false");
$instance_settings = InstanceSettings::get(); $instance_settings = InstanceSettings::get();
if (!$instance_settings->is_auto_update_enabled) { if (!$instance_settings->is_auto_update_enabled) {
return $this->delete(); return $this->delete();
@ -55,25 +50,20 @@ class InstanceAutoUpdateJob implements ShouldQueue
private function check_if_update_available() private function check_if_update_available()
{ {
if ($this->latest_version === $this->current_version) { if ($this->latest_version === $this->current_version) {
Log::info("InstanceAutoUpdateJob: Already on latest version");
throw new \Exception("Already on latest version"); throw new \Exception("Already on latest version");
} }
if (version_compare($this->latest_version, $this->current_version, '<')) { if (version_compare($this->latest_version, $this->current_version, '<')) {
Log::info("InstanceAutoUpdateJob: Already on latest version");
throw new \Exception("Already on latest version"); throw new \Exception("Already on latest version");
} }
} }
public function handle(): void public function handle(): void
{ {
try { try {
Log::info('InstanceAutoUpdateJob: Starting update process');
if (config('app.env') === 'local') { if (config('app.env') === 'local') {
instant_remote_process([ instant_remote_process([
"sleep 10" "sleep 10"
], $this->server); ], $this->server);
Log::info("InstanceAutoUpdateJob completed");
} else { } else {
Log::info('InstanceAutoUpdateJob: Running upgrade script');
instant_remote_process([ instant_remote_process([
"curl -fsSL https://coolify-cdn.b-cdn.net/files/upgrade.sh -o /data/coolify/source/upgrade.sh", "curl -fsSL https://coolify-cdn.b-cdn.net/files/upgrade.sh -o /data/coolify/source/upgrade.sh",
"bash /data/coolify/source/upgrade.sh $this->latest_version" "bash /data/coolify/source/upgrade.sh $this->latest_version"