Skip to content

Commit

Permalink
add connect timeout
Browse files Browse the repository at this point in the history
lloydzhou committed Oct 1, 2024
1 parent d830c23 commit 9531140
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src-tauri/src/stream.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//
//

use std::time::Duration;
use std::error::Error;
use std::sync::atomic::{AtomicU32, Ordering};
use std::collections::HashMap;
@@ -56,6 +57,7 @@ pub async fn stream_fetch(
let client = Client::builder()
.default_headers(_headers)
.redirect(reqwest::redirect::Policy::limited(3))
.connect_timeout(Duration::new(3, 0))
.build()
.map_err(|err| format!("failed to generate client: {}", err))?;

0 comments on commit 9531140

Please sign in to comment.