From e408e650f83241dfbc037700004d58f8914c70d9 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 4 Jul 2025 18:43:02 +0100 Subject: Add per-process timeout Side note... holy crap serde... more boilerplate than code at this point --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.rs') 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" ), -- cgit v1.2.3-70-g09d2