From f9013e8cf07d3ed5c249f04c64f5a00027e6fae4 Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Wed, 3 Jan 2024 13:16:13 +0200 Subject: [PATCH] Add possibility to override timeout via `client run` --- teleprobe/src/client.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/teleprobe/src/client.rs b/teleprobe/src/client.rs index d7be6ab..75edf3c 100644 --- a/teleprobe/src/client.rs +++ b/teleprobe/src/client.rs @@ -60,6 +60,10 @@ pub struct RunCommand { /// Show output logs for successes, not just failures. #[clap(short)] show_output: bool, + + /// Override job timeout + #[clap(short)] + timeout: Option, } pub async fn main(cmd: Command) -> anyhow::Result<()> { @@ -259,12 +263,18 @@ async fn run(creds: &Credentials, cmd: RunCommand) -> anyhow::Result<()> { continue; } + // Override timeout if requested + let timeout = match cmd.timeout { + Some(_) => cmd.timeout, + None => meta.timeout, + }; + jobs_by_target.entry(target.clone()).or_default().push(Job { path, target, elf, hash, - timeout: meta.timeout, + timeout, }); }