An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(schedule): run stale multiplex cleanup on crons queue
Andras Bacsaied3780b2a75c
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.phpindex 665553fcb3..494e6d7b67 100644--- a/app/Console/Kernel.php+++ b/app/Console/Kernel.php@@ -41,7 +41,9 @@ class Kernel extends ConsoleKernel$this->instanceTimezone = config('app.timezone');}- $this->scheduleInstance->job(new CleanupStaleMultiplexedConnections)->hourly()->onOneServer();+ $this->scheduleInstance->job(new CleanupStaleMultiplexedConnections, crons_queue())+ ->hourly()+ ->onOneServer();$this->scheduleInstance->command('cleanup:redis --clear-locks')->daily();$this->scheduleInstance->command('sanctum:prune-expired --hours=1')->hourly()->onOneServer();$this->scheduleInstance->job(new ApiTokenExpirationWarningJob)->hourly()->onOneServer();diff --git a/tests/Feature/ScheduleOnOneServerTest.php b/tests/Feature/ScheduleOnOneServerTest.phpindex 10758738cc..b110171077 100644--- a/tests/Feature/ScheduleOnOneServerTest.php+++ b/tests/Feature/ScheduleOnOneServerTest.php@@ -1,8 +1,10 @@<?php+use App\Jobs\CleanupStaleMultiplexedConnections;use App\Models\InstanceSettings;use Illuminate\Console\Scheduling\Schedule;use Illuminate\Foundation\Testing\RefreshDatabase;+use Illuminate\Support\Facades\Queue;uses(RefreshDatabase::class);@@ -21,6 +23,23 @@ it('schedules RegenerateSslCertJob with onOneServer to prevent multi-server doubexpect($event->onOneServer)->toBeTrue();});+it('schedules CleanupStaleMultiplexedConnections on the crons queue', function () {+ config(['constants.coolify.self_hosted' => false]);+ Queue::fake();++ $schedule = app(Schedule::class);++ $event = collect($schedule->events())->first(+ fn ($e) => str_contains((string) $e->description, CleanupStaleMultiplexedConnections::class)+ );++ expect($event)->not->toBeNull();++ $event->run(app());++ Queue::assertPushedOn('crons', CleanupStaleMultiplexedConnections::class);+});+it('schedules every production job with onOneServer', function () {$schedule = app(Schedule::class);