Add Redis URL configuration support to agent coordinator lifespan
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
API Endpoint Tests / test-api-endpoints (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Production Tests / Production Integration Tests (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled

- Read REDIS_URL from environment variable with default fallback to redis://localhost:6379/1
- Pass redis_url parameter to AgentRegistry initialization
- Add logging for Redis URL being used
This commit is contained in:
aitbc
2026-05-07 18:59:35 +02:00
parent a9e727dac8
commit 7d87614eab

View File

@@ -1,4 +1,5 @@
import asyncio
import os
from contextlib import asynccontextmanager
from aitbc import get_logger
@@ -18,7 +19,11 @@ async def lifespan(app: FastAPI):
from .routing.agent_discovery import AgentDiscoveryService, AgentRegistry
from .routing.load_balancer import LoadBalancer, LoadBalancingStrategy, TaskDistributor
state.agent_registry = AgentRegistry()
# Get Redis URL from environment variable
redis_url = os.getenv("REDIS_URL", "redis://localhost:6379/1")
logger.info(f"Using Redis URL: {redis_url}")
state.agent_registry = AgentRegistry(redis_url=redis_url)
await state.agent_registry.start()
state.discovery_service = AgentDiscoveryService(state.agent_registry)