chore: Revert Clients to using static LazyLock

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2025-10-13 09:26:22 +11:00
parent f0e46c4a46
commit 8e08f3b7e7

View File

@ -1,5 +1,5 @@
use std::{
cell::LazyCell, fs::{self, File}, io::Read
fs::{self, File}, io::Read, sync::LazyLock
};
use drop_consts::DATA_ROOT_DIR;
@ -17,10 +17,10 @@ impl DropHealthcheck {
&self.app_name
}
}
const DROP_CERT_BUNDLE: LazyCell<Vec<Certificate>> = LazyCell::new(fetch_certificates);
pub const DROP_CLIENT_SYNC: LazyCell<reqwest::blocking::Client> = LazyCell::new(get_client_sync);
pub const DROP_CLIENT_ASYNC: LazyCell<reqwest::Client> = LazyCell::new(get_client_async);
pub const DROP_CLIENT_WS_CLIENT: LazyCell<reqwest::Client> = LazyCell::new(get_client_ws);
static DROP_CERT_BUNDLE: LazyLock<Vec<Certificate>> = LazyLock::new(fetch_certificates);
pub static DROP_CLIENT_SYNC: LazyLock<reqwest::blocking::Client> = LazyLock::new(get_client_sync);
pub static DROP_CLIENT_ASYNC: LazyLock<reqwest::Client> = LazyLock::new(get_client_async);
pub static DROP_CLIENT_WS_CLIENT: LazyLock<reqwest::Client> = LazyLock::new(get_client_ws);
fn fetch_certificates() -> Vec<Certificate> {
let certificate_dir = DATA_ROOT_DIR.join("certificates");