From b24bb23376ac00a59d30638fed6ddec885c4f95f Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 4 Jul 2025 12:50:23 +0100 Subject: Configurable global timeout --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index cf0dbb7..9ebd103 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ // TODO: Log levels -use std::{path::PathBuf, process::Stdio, time::Duration}; +use std::{path::PathBuf, process::Stdio}; use anyhow::Context; use rumqttc::{Event::Incoming, Packet, Publish, QoS}; @@ -90,7 +90,7 @@ async fn main() -> anyhow::Result<()> { let program = program.clone(); let p = p.clone(); tokio::spawn(async move { - match timeout(Duration::from_secs(60), run(&program, &p)).await { + match timeout(conf.timeout, run(&program, &p)).await { Err(_) => eprintln!( "error: Execution of {program:?} for message {p:?} timed out" ), -- cgit v1.2.3-70-g09d2