Spaces:
Sleeping
Sleeping
David Prince commited on
Commit ·
dd7e956
1
Parent(s): 8b4653e
fix: mcp_health capabilities KeyError; verify DATABASE_URL in init_db_pool
Browse files- app_part1.py +1 -1
- mcp_routes.py +1 -1
app_part1.py
CHANGED
|
@@ -89,7 +89,7 @@ async def lifespan(app: FastAPI):
|
|
| 89 |
global db_pool
|
| 90 |
try:
|
| 91 |
db_pool = await init_db_pool()
|
| 92 |
-
logger.info("Database pool initialized
|
| 93 |
except Exception as exc:
|
| 94 |
logger.error(
|
| 95 |
"Failed to initialize Postgres pool. Falling back to memory: %s",
|
|
|
|
| 89 |
global db_pool
|
| 90 |
try:
|
| 91 |
db_pool = await init_db_pool()
|
| 92 |
+
logger.info("Database pool initialized — postgres_connected=True")
|
| 93 |
except Exception as exc:
|
| 94 |
logger.error(
|
| 95 |
"Failed to initialize Postgres pool. Falling back to memory: %s",
|
mcp_routes.py
CHANGED
|
@@ -538,7 +538,7 @@ async def mcp_health() -> JSONResponse:
|
|
| 538 |
live_servers = _servers_with_live_health()
|
| 539 |
seen: List[str] = []
|
| 540 |
for server in live_servers:
|
| 541 |
-
for cap in server
|
| 542 |
if cap not in seen:
|
| 543 |
seen.append(cap)
|
| 544 |
overall = "healthy" if all(s["health_status"] == "healthy" for s in live_servers) else "degraded"
|
|
|
|
| 538 |
live_servers = _servers_with_live_health()
|
| 539 |
seen: List[str] = []
|
| 540 |
for server in live_servers:
|
| 541 |
+
for cap in server.get("capabilities", []):
|
| 542 |
if cap not in seen:
|
| 543 |
seen.append(cap)
|
| 544 |
overall = "healthy" if all(s["health_status"] == "healthy" for s in live_servers) else "degraded"
|