mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-21 04:01:13 +10:00
chore: Revert Clients to using static LazyLock
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
use std::{
|
use std::{
|
||||||
cell::LazyCell, fs::{self, File}, io::Read
|
fs::{self, File}, io::Read, sync::LazyLock
|
||||||
};
|
};
|
||||||
|
|
||||||
use drop_consts::DATA_ROOT_DIR;
|
use drop_consts::DATA_ROOT_DIR;
|
||||||
@ -17,10 +17,10 @@ impl DropHealthcheck {
|
|||||||
&self.app_name
|
&self.app_name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const DROP_CERT_BUNDLE: LazyCell<Vec<Certificate>> = LazyCell::new(fetch_certificates);
|
static DROP_CERT_BUNDLE: LazyLock<Vec<Certificate>> = LazyLock::new(fetch_certificates);
|
||||||
pub const DROP_CLIENT_SYNC: LazyCell<reqwest::blocking::Client> = LazyCell::new(get_client_sync);
|
pub static DROP_CLIENT_SYNC: LazyLock<reqwest::blocking::Client> = LazyLock::new(get_client_sync);
|
||||||
pub const DROP_CLIENT_ASYNC: LazyCell<reqwest::Client> = LazyCell::new(get_client_async);
|
pub static DROP_CLIENT_ASYNC: LazyLock<reqwest::Client> = LazyLock::new(get_client_async);
|
||||||
pub const DROP_CLIENT_WS_CLIENT: LazyCell<reqwest::Client> = LazyCell::new(get_client_ws);
|
pub static DROP_CLIENT_WS_CLIENT: LazyLock<reqwest::Client> = LazyLock::new(get_client_ws);
|
||||||
|
|
||||||
fn fetch_certificates() -> Vec<Certificate> {
|
fn fetch_certificates() -> Vec<Certificate> {
|
||||||
let certificate_dir = DATA_ROOT_DIR.join("certificates");
|
let certificate_dir = DATA_ROOT_DIR.join("certificates");
|
||||||
|
|||||||
Reference in New Issue
Block a user