diff --git a/README.md b/README.md index 5f583df75..cf3dc21c3 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,8 @@ ## Big Sponsors * [Tolgee](https://tolgee.io?ref=coolify.io) - The open source localization platform * [CompAI](https://www.trycomp.ai?ref=coolify.io) - Open source compliance automation platform * [GoldenVM](https://billing.goldenvm.com?ref=coolify.io) - Premium virtual machine hosting solutions +* [Gozunga](https://gozunga.com?ref=coolify.io) - Seriously Simple Cloud Infrastructure +* [Macarne](https://macarne.com?ref=coolify.io) - Best IP Transit & Carrier Ethernet Solutions for Simplified Network Connectivity ## Small Sponsors diff --git a/app/Console/Commands/CleanupRedis.php b/app/Console/Commands/CleanupRedis.php index e16a82be4..315d1adc7 100644 --- a/app/Console/Commands/CleanupRedis.php +++ b/app/Console/Commands/CleanupRedis.php @@ -13,17 +13,20 @@ class CleanupRedis extends Command public function handle() { - $prefix = config('database.redis.options.prefix'); - - $keys = Redis::connection()->keys('*:laravel*'); - collect($keys)->each(function ($key) use ($prefix) { + $redis = Redis::connection('horizon'); + $keys = $redis->keys('*'); + $prefix = config('horizon.prefix'); + foreach ($keys as $key) { $keyWithoutPrefix = str_replace($prefix, '', $key); - Redis::connection()->del($keyWithoutPrefix); - }); + $type = $redis->command('type', [$keyWithoutPrefix]); - $queueOverlaps = Redis::connection()->keys('*laravel-queue-overlap*'); - collect($queueOverlaps)->each(function ($key) { - Redis::connection()->del($key); - }); + if ($type === 5) { + $data = $redis->command('hgetall', [$keyWithoutPrefix]); + $status = data_get($data, 'status'); + if ($status === 'completed') { + $redis->command('del', [$keyWithoutPrefix]); + } + } + } } } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a6f24aaad..1c5d3e70b 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -51,6 +51,7 @@ protected function schedule(Schedule $schedule): void } // $this->scheduleInstance->job(new CleanupStaleMultiplexedConnections)->hourly(); + $this->scheduleInstance->command('cleanup:redis')->everyTenMinutes(); if (isDev()) { // Instance Jobs diff --git a/app/Jobs/CleanupInstanceStuffsJob.php b/app/Jobs/CleanupInstanceStuffsJob.php index 60ae58489..53e344daf 100644 --- a/app/Jobs/CleanupInstanceStuffsJob.php +++ b/app/Jobs/CleanupInstanceStuffsJob.php @@ -23,7 +23,7 @@ public function __construct() {} public function middleware(): array { - return [(new WithoutOverlapping('cleanup-instance-stuffs'))->expireAfter(60)->dontRelease()]; + return [(new WithoutOverlapping('cleanup-instance-stuffs'))->dontRelease()]; } public function handle(): void diff --git a/app/Jobs/DockerCleanupJob.php b/app/Jobs/DockerCleanupJob.php index 7e246649d..05a4aa8de 100644 --- a/app/Jobs/DockerCleanupJob.php +++ b/app/Jobs/DockerCleanupJob.php @@ -31,7 +31,7 @@ class DockerCleanupJob implements ShouldBeEncrypted, ShouldQueue public function middleware(): array { - return [(new WithoutOverlapping($this->server->uuid))->expireAfter(600)]; + return [(new WithoutOverlapping($this->server->uuid))->dontRelease()]; } public function __construct(public Server $server, public bool $manualCleanup = false) {} diff --git a/app/Jobs/PushServerUpdateJob.php b/app/Jobs/PushServerUpdateJob.php index 4d40240f9..93b203fcb 100644 --- a/app/Jobs/PushServerUpdateJob.php +++ b/app/Jobs/PushServerUpdateJob.php @@ -71,7 +71,7 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue public function middleware(): array { - return [(new WithoutOverlapping($this->server->uuid))->expireAfter(30)]; + return [(new WithoutOverlapping($this->server->uuid))->dontRelease()]; } public function backoff(): int diff --git a/app/Jobs/RestartProxyJob.php b/app/Jobs/RestartProxyJob.php index a70ca518c..7fc716f70 100644 --- a/app/Jobs/RestartProxyJob.php +++ b/app/Jobs/RestartProxyJob.php @@ -24,7 +24,7 @@ class RestartProxyJob implements ShouldBeEncrypted, ShouldQueue public function middleware(): array { - return [(new WithoutOverlapping($this->server->uuid))->expireAfter(60)->dontRelease()]; + return [(new WithoutOverlapping($this->server->uuid))->dontRelease()]; } public function __construct(public Server $server) {} diff --git a/app/Jobs/ServerCheckJob.php b/app/Jobs/ServerCheckJob.php index 611402161..9818d5c6a 100644 --- a/app/Jobs/ServerCheckJob.php +++ b/app/Jobs/ServerCheckJob.php @@ -28,7 +28,7 @@ class ServerCheckJob implements ShouldBeEncrypted, ShouldQueue public function middleware(): array { - return [(new WithoutOverlapping($this->server->uuid))->expireAfter(60)->dontRelease()]; + return [(new WithoutOverlapping($this->server->uuid))->dontRelease()]; } public function __construct(public Server $server) {} diff --git a/config/constants.php b/config/constants.php index 9dcac646c..ec6f981ae 100644 --- a/config/constants.php +++ b/config/constants.php @@ -2,7 +2,7 @@ return [ 'coolify' => [ - 'version' => '4.0.0-beta.416', + 'version' => '4.0.0-beta.417', 'helper_version' => '1.0.8', 'realtime_version' => '1.0.8', 'self_hosted' => env('SELF_HOSTED', true), diff --git a/other/nightly/versions.json b/other/nightly/versions.json index 759bea95b..7cd46baab 100644 --- a/other/nightly/versions.json +++ b/other/nightly/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.416" + "version": "4.0.0-beta.417" }, "nightly": { - "version": "4.0.0-beta.417" + "version": "4.0.0-beta.418" }, "helper": { "version": "1.0.8" diff --git a/versions.json b/versions.json index 759bea95b..7cd46baab 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,10 @@ { "coolify": { "v4": { - "version": "4.0.0-beta.416" + "version": "4.0.0-beta.417" }, "nightly": { - "version": "4.0.0-beta.417" + "version": "4.0.0-beta.418" }, "helper": { "version": "1.0.8"