aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2025-07-04 18:43:02 +0100
committerTomasz Kramkowski <tomasz@kramkow.ski>2025-07-04 18:44:58 +0100
commite408e650f83241dfbc037700004d58f8914c70d9 (patch)
tree4db7d42ca28b31e0c10cba1701f0ea9a67fc9cfe /src/main.rs
parent4cbdc30c4083d66e7e04ee54dea2d4643467c84a (diff)
downloadmqttr-e408e650f83241dfbc037700004d58f8914c70d9.tar.gz
mqttr-e408e650f83241dfbc037700004d58f8914c70d9.tar.xz
mqttr-e408e650f83241dfbc037700004d58f8914c70d9.zip
Add per-process timeout
Side note... holy crap serde... more boilerplate than code at this point
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 9ebd103..68f62dc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -90,7 +90,12 @@ async fn main() -> anyhow::Result<()> {
let program = program.clone();
let p = p.clone();
tokio::spawn(async move {
- match timeout(conf.timeout, run(&program, &p)).await {
+ match timeout(
+ program.timeout.unwrap_or(conf.timeout),
+ run(&program.command, &p),
+ )
+ .await
+ {
Err(_) => eprintln!(
"error: Execution of {program:?} for message {p:?} timed out"
),