fix: catch microdao fetch error in get_node_by_id
This commit is contained in:
@@ -2255,6 +2255,7 @@ async def get_node_by_id(node_id: str) -> Optional[dict]:
|
|||||||
data = dict(row)
|
data = dict(row)
|
||||||
|
|
||||||
# Fetch MicroDAOs where orchestrator is on this node
|
# Fetch MicroDAOs where orchestrator is on this node
|
||||||
|
try:
|
||||||
microdaos = await pool.fetch("""
|
microdaos = await pool.fetch("""
|
||||||
SELECT m.id, m.slug, m.name, COUNT(cr.id) as rooms_count
|
SELECT m.id, m.slug, m.name, COUNT(cr.id) as rooms_count
|
||||||
FROM microdaos m
|
FROM microdaos m
|
||||||
@@ -2264,6 +2265,11 @@ async def get_node_by_id(node_id: str) -> Optional[dict]:
|
|||||||
GROUP BY m.id, m.slug, m.name
|
GROUP BY m.id, m.slug, m.name
|
||||||
ORDER BY m.name
|
ORDER BY m.name
|
||||||
""", node_id)
|
""", node_id)
|
||||||
|
except Exception as e:
|
||||||
|
import logging
|
||||||
|
logging.getLogger(__name__).error(f"DEBUG Error fetching microdaos: {e}")
|
||||||
|
# If this fails, just return empty list to avoid breaking the whole page
|
||||||
|
microdaos = []
|
||||||
|
|
||||||
data["microdaos"] = [dict(m) for m in microdaos]
|
data["microdaos"] = [dict(m) for m in microdaos]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user