Skip to content

Commit 23ee185

Browse files
authored
Merge pull request #32 from openSVM/copilot/fix-31
Fix HTTP server startup timeout by removing inappropriate timeout wrapper
2 parents 6c84ec6 + c708396 commit 23ee185

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/http_server.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use axum::{
77
};
88
use serde_json::Value;
99
use tokio::net::TcpListener;
10-
use tokio::time::{timeout, Duration};
10+
use tokio::time::Duration;
1111
use tower::ServiceBuilder;
1212
use tower_http::timeout::TimeoutLayer;
1313
use tracing::{info, error, debug};
@@ -19,8 +19,6 @@ use crate::config::Config;
1919

2020
/// HTTP request timeout (can be overridden by config)
2121
const DEFAULT_HTTP_REQUEST_TIMEOUT: Duration = Duration::from_secs(30);
22-
/// HTTP server graceful shutdown timeout
23-
const SHUTDOWN_TIMEOUT: Duration = Duration::from_secs(10);
2422

2523
/// HTTP server for metrics, health, and MCP API endpoints
2624
pub struct McpHttpServer {
@@ -87,14 +85,8 @@ impl McpHttpServer {
8785

8886
let listener = TcpListener::bind(&addr).await?;
8987

90-
// Start server with graceful shutdown handling
91-
match timeout(SHUTDOWN_TIMEOUT, axum::serve(listener, app)).await {
92-
Ok(result) => result.map_err(|e| e.into()),
93-
Err(_) => {
94-
error!("HTTP server startup timeout");
95-
Err("HTTP server startup timeout".into())
96-
}
97-
}
88+
// Start server and run indefinitely
89+
axum::serve(listener, app).await.map_err(|e| e.into())
9890
}
9991
}
10092

@@ -340,7 +332,7 @@ mod tests {
340332

341333
#[tokio::test]
342334
async fn test_llms_txt_handler() {
343-
let response = llms_txt_handler().await;
335+
let _response = llms_txt_handler().await;
344336
// The response should be either OK (if file exists) or NOT_FOUND (if file doesn't exist)
345337
// This test ensures the handler doesn't panic and returns a valid response
346338
}

0 commit comments

Comments
 (0)