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
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:
@@ -1,4 +1,5 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
import os
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
|
||||||
from aitbc import get_logger
|
from aitbc import get_logger
|
||||||
@@ -18,7 +19,11 @@ async def lifespan(app: FastAPI):
|
|||||||
from .routing.agent_discovery import AgentDiscoveryService, AgentRegistry
|
from .routing.agent_discovery import AgentDiscoveryService, AgentRegistry
|
||||||
from .routing.load_balancer import LoadBalancer, LoadBalancingStrategy, TaskDistributor
|
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()
|
await state.agent_registry.start()
|
||||||
|
|
||||||
state.discovery_service = AgentDiscoveryService(state.agent_registry)
|
state.discovery_service = AgentDiscoveryService(state.agent_registry)
|
||||||
|
|||||||
Reference in New Issue
Block a user