fix: add 5s connect_timeout to LLM HTTP client so unreachable APIs fail fast
All checks were successful
BotServer CI/CD / build (push) Successful in 3m52s
All checks were successful
BotServer CI/CD / build (push) Successful in 3m52s
Without connect_timeout, reqwest can hang for the full 60s timeout when the remote server is unreachable (DNS, TCP connect, etc.). Now fails in 5s max for connection issues, 30s for full request. This means one user's LLM failure no longer blocks new users for a full minute — the channel closes quickly and the WebSocket is freed. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
3ec72f6121
commit
da9facf036
1 changed files with 2 additions and 1 deletions
|
|
@ -200,7 +200,8 @@ impl OpenAIClient {
|
|||
|
||||
Self {
|
||||
client: reqwest::Client::builder()
|
||||
.timeout(Duration::from_secs(60))
|
||||
.connect_timeout(Duration::from_secs(5))
|
||||
.timeout(Duration::from_secs(30))
|
||||
.build()
|
||||
.unwrap_or_else(|_| reqwest::Client::new()),
|
||||
base_url: base,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue