diff --git a/crates/ptth_relay/src/server_endpoint.rs b/crates/ptth_relay/src/server_endpoint.rs index 64a5266..6319d0e 100644 --- a/crates/ptth_relay/src/server_endpoint.rs +++ b/crates/ptth_relay/src/server_endpoint.rs @@ -133,7 +133,7 @@ pub async fn handle_listen ( Ok (error_reply (StatusCode::INTERNAL_SERVER_ERROR, "Server error")?) }, }, - _ = tokio::time::sleep (Duration::from_secs (30)).fuse () => { + _ = tokio::time::sleep (Duration::from_secs (25)).fuse () => { debug! ("Timed out http_listen for server {} {}", watcher_code, listen_id); return Ok (error_reply (StatusCode::NO_CONTENT, "No requests now, long-poll again")?) } diff --git a/crates/ptth_server/src/lib.rs b/crates/ptth_server/src/lib.rs index 66db7d7..c1a558c 100644 --- a/crates/ptth_server/src/lib.rs +++ b/crates/ptth_server/src/lib.rs @@ -294,7 +294,9 @@ async fn run_server_loop ( debug! ("http_listen"); - let req_req = state.client.get (&format! ("{}/http_listen/{}", state.config.relay_url, state.file_server.metrics_startup.server_name)).send (); + let req_req = state.client.get (&format! ("{}/http_listen/{}", state.config.relay_url, state.file_server.metrics_startup.server_name)) + .timeout (Duration::from_secs (30)) + .send (); let err_backoff_delay = std::cmp::min (30_000, backoff_delay * 2 + 500);