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(proxy): persist running status from Sentinel push updates (#12237)
Andras Bacsaid55852ee9494
diff --git a/app/Jobs/PushServerUpdateJob.php b/app/Jobs/PushServerUpdateJob.phpindex 768ebddb22..b4e7929cd6 100644--- a/app/Jobs/PushServerUpdateJob.php+++ b/app/Jobs/PushServerUpdateJob.php@@ -826,6 +826,9 @@ class PushServerUpdateJob implements ShouldBeEncrypted, ShouldQueue, Silenced}} catch (\Throwable $e) {}+ } elseif ($this->server->proxy->get('status') !== 'running') {+ $this->server->proxy->set('status', 'running');+ $this->server->save();}}}diff --git a/tests/Feature/PushServerUpdateJobOptimizationTest.php b/tests/Feature/PushServerUpdateJobOptimizationTest.phpindex ffe73a1bfd..61e6dfe78c 100644--- a/tests/Feature/PushServerUpdateJobOptimizationTest.php+++ b/tests/Feature/PushServerUpdateJobOptimizationTest.php@@ -146,6 +146,33 @@ it('does not dispatch proxy network work when the proxy is running', function ()Queue::assertNothingPushed();});+it('marks a stale proxy status as running when sentinel reports a running proxy', function () {+ $team = Team::factory()->create();+ $server = Server::factory()->create(['team_id' => $team->id]);+ $server->settings->update(['is_reachable' => true, 'is_usable' => true]);+ $server->proxy->set('type', 'TRAEFIK');+ $server->proxy->set('status', 'exited');+ $server->save();++ $data = [+ 'containers' => [+ [+ 'name' => 'coolify-proxy',+ 'state' => 'running',+ 'health_status' => 'healthy',+ 'labels' => ['coolify.managed' => true],+ ],+ ],+ 'filesystem_usage_root' => ['used_percentage' => 10],+ ];++ Event::fake([ServiceChecked::class]);++ (new PushServerUpdateJob($server, $data))->handle();++ expect($server->fresh()->proxy->get('status'))->toBe('running');+});+it('uses default queue for PushServerUpdateJob', function () {$team = Team::factory()->create();$server = Server::factory()->create(['team_id' => $team->id]);