[router] configure workflow retries and timeout based on routerConfig (#12252)

This commit is contained in:
Simo Lin
2025-10-28 00:41:20 -07:00
committed by GitHub
parent c5642a7a7a
commit d85d6dba3b
4 changed files with 38 additions and 11 deletions
+7 -2
View File
@@ -737,14 +737,17 @@ pub async fn startup(config: ServerConfig) -> Result<(), Box<dyn std::error::Err
.subscribe(Arc::new(LoggingSubscriber))
.await;
engine.register_workflow(create_worker_registration_workflow());
engine.register_workflow(create_worker_registration_workflow(&config.router_config));
engine.register_workflow(create_worker_removal_workflow());
engine.register_workflow(create_mcp_registration_workflow());
app_context
.workflow_engine
.set(engine)
.expect("WorkflowEngine should only be initialized once");
info!("Workflow engine initialized with worker and MCP registration workflows");
info!(
"Workflow engine initialized with worker and MCP registration workflows (health check timeout: {}s)",
config.router_config.health_check.timeout_secs
);
info!(
"Initializing workers for routing mode: {:?}",
@@ -764,6 +767,8 @@ pub async fn startup(config: ServerConfig) -> Result<(), Box<dyn std::error::Err
.await
.map_err(|e| format!("Failed to submit worker initialization job: {}", e))?;
info!("Worker initialization job submitted (will complete in background)");
if let Some(mcp_config) = &config.router_config.mcp_config {
info!("Found {} MCP server(s) in config", mcp_config.servers.len());
let mcp_job = Job::InitializeMcpServers {