diff --git a/worker/src/build.rs b/worker/src/build.rs index ba36948..654e412 100644 --- a/worker/src/build.rs +++ b/worker/src/build.rs @@ -293,7 +293,10 @@ async fn build_worker_inner(args: &Args) -> anyhow::Result<()> { info!("Receiving new messages"); - let client = reqwest::Client::new(); + let client = reqwest::Client::builder() + .timeout(Duration::from_secs(30)) + .build() + .unwrap(); let req = WorkerPollRequest { hostname: gethostname::gethostname().to_string_lossy().to_string(), arch: args.arch.clone(), diff --git a/worker/src/heartbeat.rs b/worker/src/heartbeat.rs index d0966f9..f2392ab 100644 --- a/worker/src/heartbeat.rs +++ b/worker/src/heartbeat.rs @@ -4,7 +4,10 @@ use log::{info, warn}; use std::time::Duration; pub async fn heartbeat_worker_inner(args: &Args) -> anyhow::Result<()> { - let client = reqwest::Client::new(); + let client = reqwest::Client::builder() + .timeout(Duration::from_secs(30)) + .build() + .unwrap(); loop { // info!("Sending heartbeat"); client