From 9960a0e05da6106dec982b0f5cea728cd27a8128 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sat, 29 Jun 2024 19:38:22 -0400 Subject: [PATCH] linting --- martin/src/srv/server.rs | 1 + martin/src/srv/tiles_info.rs | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/martin/src/srv/server.rs b/martin/src/srv/server.rs index 27682aac1..83707ba2d 100755 --- a/martin/src/srv/server.rs +++ b/martin/src/srv/server.rs @@ -180,6 +180,7 @@ pub fn new_server( state: ServerState, ) -> MartinResult<(Server, String)> { let catalog = Catalog::new(&state)?; + let keep_alive = Duration::from_secs(config.keep_alive.unwrap_or(KEEP_ALIVE_DEFAULT)); let worker_processes = config.worker_processes.unwrap_or_else(num_cpus::get); let listen_addresses = config diff --git a/martin/src/srv/tiles_info.rs b/martin/src/srv/tiles_info.rs index e534b2899..964ebd4e0 100755 --- a/martin/src/srv/tiles_info.rs +++ b/martin/src/srv/tiles_info.rs @@ -48,14 +48,16 @@ async fn get_source_info( }; // Construct a tiles URL from the request info, including the query string if present. - let info = req.connection_info(); - let tiles_url = Uri::builder() - .scheme(info.scheme()) - .authority(info.host()) - .path_and_query(path_and_query) - .build() - .map(|tiles_url| tiles_url.to_string()) - .map_err(|e| ErrorBadRequest(format!("Can't build tiles URL: {e}")))?; + let tiles_url = { + let info = req.connection_info(); + Uri::builder() + .scheme(info.scheme()) + .authority(info.host()) + .path_and_query(path_and_query) + .build() + .map(|tiles_url| tiles_url.to_string()) + .map_err(|e| ErrorBadRequest(format!("Can't build tiles URL: {e}")))? + }; let sources = sources.read().await; let sources = sources.get_sources(&path.source_ids, None)?.0;