chore: sync current workspace changes
This commit is contained in:
@@ -11,11 +11,13 @@ Provides REST API endpoints for:
|
||||
from .agents import router as agents_router
|
||||
from .workspaces import router as workspaces_router
|
||||
from .guard import router as guard_router
|
||||
from .openclaw import router as openclaw_router
|
||||
from .runtime import router as runtime_router
|
||||
|
||||
__all__ = [
|
||||
"agents_router",
|
||||
"workspaces_router",
|
||||
"guard_router",
|
||||
"openclaw_router",
|
||||
"runtime_router",
|
||||
]
|
||||
|
||||
@@ -389,11 +389,21 @@ def _find_available_port(start_port: int = 8765, max_port: int = 9000) -> int:
|
||||
|
||||
|
||||
def _is_gateway_running() -> bool:
|
||||
"""Check if Gateway process is running."""
|
||||
"""Check if Gateway process is running.
|
||||
|
||||
Checks both the internally-managed gateway process and falls back to
|
||||
port availability (for externally-managed gateway processes).
|
||||
"""
|
||||
process = _runtime_state.gateway_process
|
||||
if process is None:
|
||||
if process is not None and process.poll() is None:
|
||||
return True
|
||||
# Fallback: check if the gateway port is in use (for externally started gateway)
|
||||
import socket
|
||||
try:
|
||||
with socket.create_connection(("127.0.0.1", _runtime_state.gateway_port), timeout=1):
|
||||
return True
|
||||
except OSError:
|
||||
return False
|
||||
return process.poll() is None
|
||||
|
||||
|
||||
def _stop_gateway() -> bool:
|
||||
|
||||
Reference in New Issue
Block a user