remove debugs
This commit is contained in:
parent
ac424ce529
commit
c97656d45e
@ -21,7 +21,6 @@ class InstanceAutoUpdateJob implements ShouldQueue
|
||||
|
||||
public function __construct(private bool $force = false)
|
||||
{
|
||||
Log::info("InstanceAutoUpdateJob");
|
||||
if (config('app.env') === 'local') {
|
||||
$server_name = 'testing-local-docker-container';
|
||||
} else {
|
||||
@ -32,14 +31,10 @@ class InstanceAutoUpdateJob implements ShouldQueue
|
||||
throw new \Exception("Server not found");
|
||||
}
|
||||
$this->server = $server;
|
||||
|
||||
$this->latest_version = get_latest_version_of_coolify();
|
||||
$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) {
|
||||
Log::info("InstanceAutoUpdateJob: force is false");
|
||||
$instance_settings = InstanceSettings::get();
|
||||
if (!$instance_settings->is_auto_update_enabled) {
|
||||
return $this->delete();
|
||||
@ -55,25 +50,20 @@ class InstanceAutoUpdateJob implements ShouldQueue
|
||||
private function check_if_update_available()
|
||||
{
|
||||
if ($this->latest_version === $this->current_version) {
|
||||
Log::info("InstanceAutoUpdateJob: Already on latest version");
|
||||
throw new \Exception("Already on latest version");
|
||||
}
|
||||
if (version_compare($this->latest_version, $this->current_version, '<')) {
|
||||
Log::info("InstanceAutoUpdateJob: Already on latest version");
|
||||
throw new \Exception("Already on latest version");
|
||||
}
|
||||
}
|
||||
public function handle(): void
|
||||
{
|
||||
try {
|
||||
Log::info('InstanceAutoUpdateJob: Starting update process');
|
||||
if (config('app.env') === 'local') {
|
||||
instant_remote_process([
|
||||
"sleep 10"
|
||||
], $this->server);
|
||||
Log::info("InstanceAutoUpdateJob completed");
|
||||
} else {
|
||||
Log::info('InstanceAutoUpdateJob: Running upgrade script');
|
||||
instant_remote_process([
|
||||
"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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user