diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2025-07-04 12:50:23 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2025-07-04 12:50:23 +0100 |
commit | b24bb23376ac00a59d30638fed6ddec885c4f95f (patch) | |
tree | d6f28d31f349642554026045316ec818d371389b /src/main.rs | |
parent | 12d85f363249cbda7002af79c88d48ad0a36746b (diff) | |
download | mqttr-b24bb23376ac00a59d30638fed6ddec885c4f95f.tar.gz mqttr-b24bb23376ac00a59d30638fed6ddec885c4f95f.tar.xz mqttr-b24bb23376ac00a59d30638fed6ddec885c4f95f.zip |
Configurable global timeout
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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" ), |