Skip to content

Commit 2c88705

Browse files
committed
Merge #14: Make max submission age configurable
Approved-by: rlycx Priority: Normal Auto-deploy: false
2 parents 90527c0 + 1a2cefd commit 2c88705

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/opsqueue_python/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "opsqueue_python"
3-
version = "0.30.6"
3+
version = "0.30.7"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

opsqueue/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "opsqueue"
3-
version = "0.30.6"
3+
version = "0.30.7"
44
edition = "2021"
55
description = "lightweight batch processing queue for heavy loads"
66
repository = "https://github.com/channable/opsqueue"

opsqueue/app/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub async fn async_main() {
4848
prometheus_config,
4949
));
5050

51-
let max_age = Duration::from_secs(60 * 60);
51+
let max_age = config.max_submission_age.into();
5252
scope.spawn(periodically_cleanup_old(db_pool.writer_pool(), max_age));
5353

5454
scope.spawn(prometheus::periodically_calculate_scaling_metrics(

opsqueue/src/config.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ pub struct Config {
7474
/// the full submission the chunk is a part of.
7575
#[arg(long, default_value_t = 10)]
7676
pub max_chunk_retries: u32,
77+
78+
#[arg(long, default_value = "1 hour")]
79+
pub max_submission_age: humantime::Duration,
7780
}
7881

7982
impl Default for Config {
@@ -88,6 +91,7 @@ impl Default for Config {
8891
humantime::Duration::from_str("10 seconds").expect("valid humantime");
8992
let max_missable_heartbeats = 3;
9093
let max_chunk_retries = 10;
94+
let max_submission_age = humantime::Duration::from_str("1 hour").expect("valid humantime");
9195
Config {
9296
port,
9397
database_filename,
@@ -96,6 +100,7 @@ impl Default for Config {
96100
heartbeat_interval,
97101
max_missable_heartbeats,
98102
max_chunk_retries,
103+
max_submission_age,
99104
}
100105
}
101106
}

0 commit comments

Comments
 (0)