INNER CODE UNIT · Python
_run_source
marc-shade/world-intel-mcp · src/world_intel_mcp/dashboard/app.py:424
async def _run_source(name: str, factory):
timeout = 90.0 if name in _SLOW else 45.0
try:
data = await asyncio.wait_for(factory(), timeout=timeout)
except asyncio.TimeoutError:
data = {"error": f"timeout after {timeout}s", "_timeout": True}
except Exception as exc:
data = {"error": f"{type(exc).__name__}: {str(exc)[:120]}"}
await results_q.put((name, data))
# Fire all sources concurrently
tasks = [
asyncio.create_task(_run_source(name, factory))
for name, factory in source_defs.items()
]
total = len(tasks)
completed = 0