Skip to content

Commit f059e7f

Browse files
committed
switch to LazyLock
1 parent 28a1395 commit f059e7f

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ 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"
3130

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

rust/crd/Cargo.toml

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

2221
[dev-dependencies]
2322
rstest.workspace = true

rust/crd/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use lazy_static::lazy_static;
21
use product_config::types::PropertyNameKind;
32
use security::AuthenticationConfig;
43
use serde::{Deserialize, Serialize};
@@ -30,6 +29,7 @@ use stackable_operator::{
3029
};
3130
use std::collections::BTreeMap;
3231
use std::collections::HashMap;
32+
use std::sync::LazyLock;
3333
use strum::{Display, EnumIter, EnumString};
3434

3535
use crate::affinity::get_affinity;
@@ -90,10 +90,8 @@ const DEFAULT_MASTER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minute
9090
const DEFAULT_REGION_MOVER_TIMEOUT: Duration = Duration::from_minutes_unchecked(59);
9191
const DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN: Duration = Duration::from_minutes_unchecked(1);
9292
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-
}
93+
static DEFAULT_REGION_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: LazyLock<Duration> =
94+
LazyLock::new(|| DEFAULT_REGION_MOVER_TIMEOUT + DEFAULT_REGION_MOVER_DELTA_TO_SHUTDOWN);
9795

9896
#[derive(Snafu, Debug)]
9997
pub enum Error {

0 commit comments

Comments
 (0)