From d83cee26f5740517dafcf6ad9bf36f9a46a751ef Mon Sep 17 00:00:00 2001 From: Riley Apeldoorn Date: Wed, 1 Oct 2025 10:13:16 +0200 Subject: [PATCH 1/2] Make the maximum submission age configurable --- opsqueue/app/main.rs | 2 +- opsqueue/src/config.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/opsqueue/app/main.rs b/opsqueue/app/main.rs index 95d4bb4..e3cc6d6 100644 --- a/opsqueue/app/main.rs +++ b/opsqueue/app/main.rs @@ -48,7 +48,7 @@ pub async fn async_main() { prometheus_config, )); - let max_age = Duration::from_secs(60 * 60); + let max_age = config.max_submission_age.into(); scope.spawn(periodically_cleanup_old(db_pool.writer_pool(), max_age)); scope.spawn(prometheus::periodically_calculate_scaling_metrics( diff --git a/opsqueue/src/config.rs b/opsqueue/src/config.rs index a56264b..08acd42 100644 --- a/opsqueue/src/config.rs +++ b/opsqueue/src/config.rs @@ -74,6 +74,9 @@ pub struct Config { /// the full submission the chunk is a part of. #[arg(long, default_value_t = 10)] pub max_chunk_retries: u32, + + #[arg(long, default_value = "1 hour")] + pub max_submission_age: humantime::Duration, } impl Default for Config { @@ -88,6 +91,7 @@ impl Default for Config { humantime::Duration::from_str("10 seconds").expect("valid humantime"); let max_missable_heartbeats = 3; let max_chunk_retries = 10; + let max_submission_age = humantime::Duration::from_str("1 hour").expect("valid humantime"); Config { port, database_filename, @@ -96,6 +100,7 @@ impl Default for Config { heartbeat_interval, max_missable_heartbeats, max_chunk_retries, + max_submission_age, } } } From 1a2cefd844519e9c27b72024d07cdedecf8232e6 Mon Sep 17 00:00:00 2001 From: Riley Apeldoorn Date: Wed, 1 Oct 2025 10:13:48 +0200 Subject: [PATCH 2/2] Bump version to 0.30.7 --- Cargo.lock | 4 ++-- libs/opsqueue_python/Cargo.toml | 2 +- opsqueue/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 312d7f9..42fd621 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2066,7 +2066,7 @@ dependencies = [ [[package]] name = "opsqueue" -version = "0.30.5" +version = "0.30.7" dependencies = [ "anyhow", "arc-swap", @@ -2120,7 +2120,7 @@ dependencies = [ [[package]] name = "opsqueue_python" -version = "0.30.5" +version = "0.30.7" dependencies = [ "anyhow", "chrono", diff --git a/libs/opsqueue_python/Cargo.toml b/libs/opsqueue_python/Cargo.toml index 1a33888..eb43975 100644 --- a/libs/opsqueue_python/Cargo.toml +++ b/libs/opsqueue_python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "opsqueue_python" -version = "0.30.6" +version = "0.30.7" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/opsqueue/Cargo.toml b/opsqueue/Cargo.toml index 07629e4..4a1a889 100644 --- a/opsqueue/Cargo.toml +++ b/opsqueue/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "opsqueue" -version = "0.30.6" +version = "0.30.7" edition = "2021" description = "lightweight batch processing queue for heavy loads" repository = "https://github.com/channable/opsqueue"