Skip to content

Commit 28a1395

Browse files
committed
fix const arithmetic
1 parent 8d7265e commit 28a1395

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ product-config = { git = "https://github.com/stackabletech/product-config.git",
2727
strum = { version = "0.26", features = ["derive"] }
2828
tokio = { version = "1.40", features = ["full"] }
2929
tracing = "0.1"
30+
lazy_static = "1.5"
3031

3132
#[patch."https://github.com/stackabletech/operator-rs.git"]
3233
#stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }

rust/crd/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ snafu.workspace = true
1717
stackable-operator.workspace = true
1818
strum.workspace = true
1919
tracing.workspace = true
20+
lazy_static.workspace = true
2021

2122
[dev-dependencies]
2223
rstest.workspace = true

rust/crd/src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use lazy_static::lazy_static;
12
use product_config::types::PropertyNameKind;
23
use security::AuthenticationConfig;
34
use serde::{Deserialize, Serialize};
@@ -86,12 +87,13 @@ pub const METRICS_PORT: u16 = 9100;
8687
pub const JVM_HEAP_FACTOR: f32 = 0.8;
8788

8889
const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(20);
89-
const DEFAULT_REGION_MOVER_TIMEOUT: Duration = Duration::from_minutes_unchecked(59);
90+
const DEFAULT_REGION_MOVER_TIMEOUT: Duration = Duration::from_minutes_unchecked(59);
9091
const DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN: Duration = Duration::from_minutes_unchecked(1);
91-
const DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN;
92-
93-
9492
const DEFAULT_REST_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(5);
93+
lazy_static! {
94+
static ref DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration =
95+
DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN;
96+
}
9597

9698
#[derive(Snafu, Debug)]
9799
pub enum Error {
@@ -315,7 +317,7 @@ fn default_regionserver_config(
315317
&HbaseRole::RegionServer,
316318
hdfs_discovery_cm_name,
317319
),
318-
graceful_shutdown_timeout: Some(DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT),
320+
graceful_shutdown_timeout: Some(*DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT),
319321
region_mover: Some(RegionMover::default()),
320322
}
321323
}

0 commit comments

Comments
 (0)