]> Untitled Git - lemmy.git/commitdiff
Adding a reqwest timeout. Fixes #2089 (#2097)
authorDessalines <dessalines@users.noreply.github.com>
Tue, 15 Feb 2022 12:53:57 +0000 (07:53 -0500)
committerGitHub <noreply@github.com>
Tue, 15 Feb 2022 12:53:57 +0000 (12:53 +0000)
src/main.rs

index 74f92fd178f4bd93f3cfbec4b2937e42acc08f78..3b6986afd1c5637a65fc51b0ba1a38560ea927d4 100644 (file)
@@ -31,7 +31,7 @@ use lemmy_websocket::{chat_server::ChatServer, LemmyContext};
 use reqwest::Client;
 use reqwest_middleware::ClientBuilder;
 use reqwest_tracing::TracingMiddleware;
-use std::{env, sync::Arc, thread};
+use std::{env, sync::Arc, thread, time::Duration};
 use tokio::sync::Mutex;
 use tracing_actix_web::TracingLogger;
 
@@ -96,6 +96,7 @@ async fn main() -> Result<(), LemmyError> {
 
   let client = Client::builder()
     .user_agent(build_user_agent(&settings))
+    .timeout(Duration::from_secs(10))
     .build()?;
 
   let client = ClientBuilder::new(client).with(TracingMiddleware).build();