From 2da5584bb555a564c382774bd4ad03ae39184ddb Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 4 Dec 2024 17:39:07 +0100 Subject: [PATCH 1/2] Make the tasks pulling timeout configurable --- crates/xtask/src/bench/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/xtask/src/bench/mod.rs b/crates/xtask/src/bench/mod.rs index fdb2c4963..891742528 100644 --- a/crates/xtask/src/bench/mod.rs +++ b/crates/xtask/src/bench/mod.rs @@ -82,6 +82,10 @@ pub struct BenchDeriveArgs { /// Reason for the benchmark invocation #[arg(short, long)] reason: Option, + + /// The maximum time in seconds we allow for fetching the task queue before timing out. + #[arg(long, default_value_t = 60)] + tasks_queue_timeout_secs: u64, } pub fn run(args: BenchDeriveArgs) -> anyhow::Result<()> { @@ -127,7 +131,7 @@ pub fn run(args: BenchDeriveArgs) -> anyhow::Result<()> { let meili_client = Client::new( Some("http://127.0.0.1:7700".into()), args.master_key.as_deref(), - Some(std::time::Duration::from_secs(60)), + Some(std::time::Duration::from_secs(args.tasks_queue_timeout_secs)), )?; // enter runtime From d0c4e6da6bceb7d079c1a29ac5d95d796a63810c Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 4 Dec 2024 14:32:45 +0100 Subject: [PATCH 2/2] Make clippy happy --- crates/xtask/src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/xtask/src/main.rs b/crates/xtask/src/main.rs index b81424666..942362f4f 100644 --- a/crates/xtask/src/main.rs +++ b/crates/xtask/src/main.rs @@ -16,6 +16,7 @@ struct ListFeaturesDeriveArgs { #[command(author, version, about, long_about)] #[command(name = "cargo xtask")] #[command(bin_name = "cargo xtask")] +#[allow(clippy::large_enum_variant)] // please, that's enough... enum Command { ListFeatures(ListFeaturesDeriveArgs), Bench(BenchDeriveArgs),