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(sentinel): restore hourly version checks for enabled servers
Andras Bacsai22fbbd74ffc1
diff --git a/app/Jobs/ServerManagerJob.php b/app/Jobs/ServerManagerJob.phpindex 171d4e6949..20b60b9fd2 100644--- a/app/Jobs/ServerManagerJob.php+++ b/app/Jobs/ServerManagerJob.php@@ -166,6 +166,12 @@ class ServerManagerJob implements ShouldBeEncrypted, ShouldQueue}}+ if ($server->isSentinelEnabled()+ && shouldRunCronNow('0 * * * *', $serverTimezone, "sentinel-version-check:{$server->id}", $this->executionTime)+ ) {+ CheckAndStartSentinelJob::dispatch($server);+ }+// Dispatch ServerStorageCheckJob if due (only when Sentinel is out of sync or disabled)// When Sentinel is active, PushServerUpdateJob handles storage checks with real-time dataif ($sentinelOutOfSync) {diff --git a/tests/Feature/Server/SentinelUpdateCheckIndependenceTest.php b/tests/Feature/Server/SentinelUpdateCheckIndependenceTest.phpindex 080a3ee7c8..d3ccb5c478 100644--- a/tests/Feature/Server/SentinelUpdateCheckIndependenceTest.php+++ b/tests/Feature/Server/SentinelUpdateCheckIndependenceTest.php@@ -13,6 +13,7 @@ uses(RefreshDatabase::class);beforeEach(function () {Queue::fake();+ InstanceSettings::forceCreate(['id' => 0]);// Create user (which automatically creates a team)$user = User::factory()->create();@@ -123,10 +124,9 @@ it('respects server timezone when checking sentinel updates', function () {});});-it('does not dispatch sentinel check for servers without sentinel enabled', function () {- // Disable sentinel+it('does not dispatch sentinel check for build servers', function () {$this->server->settings->update([- 'is_sentinel_enabled' => false,+ 'is_build_server' => true,]);$instanceSettings = InstanceSettings::first();@@ -144,13 +144,13 @@ it('does not dispatch sentinel check for servers without sentinel enabled', funcQueue::assertNotPushed(CheckAndStartSentinelJob::class);});-it('handles multiple servers with different sentinel configurations', function () {- // Create a second server with sentinel disabled+it('handles multiple servers with different sentinel eligibility', function () {+ // Create a second server that cannot run Sentinel$server2 = Server::factory()->create(['team_id' => $this->team->id,]);$server2->settings->update([- 'is_sentinel_enabled' => false,+ 'is_build_server' => true,'server_timezone' => 'UTC',]);diff --git a/tests/Unit/ServerManagerJobSentinelCheckTest.php b/tests/Unit/ServerManagerJobSentinelCheckTest.phpindex 4666565fe4..f2a49bad3d 100644--- a/tests/Unit/ServerManagerJobSentinelCheckTest.php+++ b/tests/Unit/ServerManagerJobSentinelCheckTest.php@@ -18,7 +18,7 @@ afterEach(function () {Carbon::setTestNow();});-it('does not dispatch CheckAndStartSentinelJob hourly anymore', function () {+it('dispatches an hourly Sentinel version check for a healthy Sentinel', function () {$settings = Mockery::mock(InstanceSettings::class);$settings->instance_timezone = 'UTC';$this->app->instance(InstanceSettings::class, $settings);@@ -39,8 +39,9 @@ it('does not dispatch CheckAndStartSentinelJob hourly anymore', function () {$job = new ServerManagerJob;$job->handle();- // Hourly CheckAndStartSentinelJob dispatch was removed — ServerCheckJob handles it when Sentinel is out of sync- Queue::assertNotPushed(CheckAndStartSentinelJob::class);+ Queue::assertPushed(CheckAndStartSentinelJob::class, function ($job) use ($server) {+ return $job->server->id === $server->id;+ });});it('does not schedule periodic Sentinel restart checks', function () {