macOS: stop flapping gateway port

This commit is contained in:
Wes
2026-01-15 16:55:26 -08:00
parent f726656d1e
commit 509215e935
2 changed files with 11 additions and 2 deletions

View File

@@ -87,6 +87,14 @@ final class GatewayProcessManager {
self.status = .stopped
return
}
// Many surfaces can call `setActive(true)` in quick succession (startup, Canvas, health checks).
// Avoid spawning multiple concurrent "start" tasks that can thrash launchd and flap the port.
switch self.status {
case .starting, .running, .attachedExisting:
return
case .stopped, .failed:
break
}
self.status = .starting
self.logger.debug("gateway start requested")