From 507bf160a76a5ef14812d820cf316ee652ae3951 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Fri, 28 Feb 2025 14:36:05 +0530 Subject: [PATCH] refactor: remove use of `lazy_static` ref: https://github.com/rust-lang-nursery/lazy-static.rs/issues/214 --- Cargo.lock | 1 - Cargo.toml | 1 - src/handlers/http/health_check.rs | 5 ++--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0eaa3e55e..44ddcc2e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3478,7 +3478,6 @@ dependencies = [ "humantime", "humantime-serde", "itertools 0.14.0", - "lazy_static", "num_cpus", "object_store", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index a8e4e9a56..a8d9ccdec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,7 +106,6 @@ bytes = "1.4" clokwerk = "0.4" derive_more = { version = "1", features = ["full"] } itertools = "0.14" -lazy_static = "1.4" once_cell = "1.20" rand = "0.8.5" regex = "1.7.3" diff --git a/src/handlers/http/health_check.rs b/src/handlers/http/health_check.rs index 7bb1fed97..d99d62c7d 100644 --- a/src/handlers/http/health_check.rs +++ b/src/handlers/http/health_check.rs @@ -27,15 +27,14 @@ use actix_web::{ HttpResponse, }; use http::StatusCode; +use once_cell::sync::Lazy; use tokio::{sync::Mutex, task::JoinSet}; use tracing::{error, info, warn}; use crate::parseable::PARSEABLE; // Create a global variable to store signal status -lazy_static::lazy_static! { - pub static ref SIGNAL_RECEIVED: Arc> = Arc::new(Mutex::new(false)); -} +static SIGNAL_RECEIVED: Lazy>> = Lazy::new(|| Arc::new(Mutex::new(false))); pub async fn liveness() -> HttpResponse { HttpResponse::new(StatusCode::OK)