fix(cleanup): disable unreachable self-hosted servers

Preserve self-hosted server IPs during unreachable cleanup and force-disable them instead. Keep cloud cleanup behavior overwriting the IP, with test coverage for both paths.
This commit is contained in:
Andras Bacsai committed 2026-05-31 21:47:18 +02:00
1 parent c9fcc0bc44
commit 1b68f11ec0
2 files changed
+34 -4

No files matched your search

@@ -18,9 +18,13 @@ class CleanupUnreachableServers extends Command
if ($servers->count() > 0) {
foreach ($servers as $server) {
echo "Cleanup unreachable server ($server->id) with name $server->name";
$server->update([
'ip' => '1.2.3.4',
]);
if (isCloud()) {
$server->update([
'ip' => '1.2.3.4',
]);
} else {
$server->forceDisableServer();
}
}
}
}