diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 01:11:29 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 01:11:29 +0100 |
| commit | 81c19a8a4f1c99f721d4c65fbcddcec6474b752b (patch) | |
| tree | 3b2320a40725420ef18669a15b1aa41e637e86c6 /src/main.rs | |
| parent | tts: bound the audio cache and request length (diff) | |
| download | senator-sperma-81c19a8a4f1c99f721d4c65fbcddcec6474b752b.tar.gz senator-sperma-81c19a8a4f1c99f721d4c65fbcddcec6474b752b.zip | |
http: add connect and request timeouts
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 56f81cb..132e93b 100644 --- a/src/main.rs +++ b/src/main.rs | |||
| @@ -149,7 +149,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { | |||
| 149 | let config = config::Config::from_env(); | 149 | let config = config::Config::from_env(); |
| 150 | 150 | ||
| 151 | let db_pool = database::init_pool(&config.database_path).await?; | 151 | let db_pool = database::init_pool(&config.database_path).await?; |
| 152 | let http_client = reqwest::Client::new(); | 152 | // Connect timeout only: body timeouts are set per-call where a finite |
| 153 | // deadline makes sense (LLM/search/web), while media downloads may | ||
| 154 | // legitimately take a long time. | ||
| 155 | let http_client = reqwest::Client::builder() | ||
| 156 | .connect_timeout(Duration::from_secs(10)) | ||
| 157 | .build()?; | ||
| 153 | 158 | ||
| 154 | let copyparty = copyparty::CopypartyClient::new( | 159 | let copyparty = copyparty::CopypartyClient::new( |
| 155 | config.copyparty_url.clone(), | 160 | config.copyparty_url.clone(), |
