From f3ce20be6b225b779f30d6f59ae352ae5fafe01f Mon Sep 17 00:00:00 2001 From: KekmaTime <22am014@sctce.ac.in> Date: Fri, 22 Mar 2024 04:23:00 +0530 Subject: [PATCH] Fixed import issue in `tcp_connection_keepalive` --- src/config/parser.rs | 3 +++ src/server/routes/search.rs | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config/parser.rs b/src/config/parser.rs index fa61ce0..e872884 100644 --- a/src/config/parser.rs +++ b/src/config/parser.rs @@ -42,6 +42,8 @@ pub struct Config { /// It stores the level of safe search to be used for restricting content in the /// search results. pub safe_search: u8, + /// It stores the TCP connection keepalive duration in seconds. + pub tcp_connection_keepalive: u64, } impl Config { @@ -131,6 +133,7 @@ impl Config { upstream_search_engines: globals .get::<_, HashMap>("upstream_search_engines")?, request_timeout: globals.get::<_, u8>("request_timeout")?, + tcp_connection_keepalive: globals.get::<_, u64>("tcp_connection_keepalive")?, threads, rate_limiter: RateLimiter { number_of_requests: rate_limiter["number_of_requests"], diff --git a/src/server/routes/search.rs b/src/server/routes/search.rs index c6f3b9d..103b581 100644 --- a/src/server/routes/search.rs +++ b/src/server/routes/search.rs @@ -216,7 +216,6 @@ async fn results( .filter_map(|engine| EngineHandler::new(engine).ok()) .collect::>(), safe_search_level, - 30, ) .await? }