This commit is contained in:
2023-07-21 01:41:14 +02:00
parent 4b171e5670
commit bbbec9773a
4 changed files with 7 additions and 8 deletions

2
Cargo.lock generated
View File

@@ -209,9 +209,9 @@ dependencies = [
"ctrlc", "ctrlc",
"dateparser", "dateparser",
"futures", "futures",
"lazy_static",
"log", "log",
"moka", "moka",
"once_cell",
"pretty_env_logger", "pretty_env_logger",
"regex", "regex",
"reqwest", "reqwest",

View File

@@ -25,7 +25,6 @@ regex = "1.8.3"
chrono = "0.4.25" chrono = "0.4.25"
dateparser = "0.2.0" dateparser = "0.2.0"
sentry = "0.31.3" sentry = "0.31.3"
lazy_static = "1.4.0"
moka = { version = "0.11.1", features = ["future"] } moka = { version = "0.11.1", features = ["future"] }
axum = "0.6.18" axum = "0.6.18"
smallvec = { version = "1.10.0", features = ["serde"] } smallvec = { version = "1.10.0", features = ["serde"] }
@@ -33,3 +32,4 @@ smartstring = { version = "1.0.1", features = ["serde"] }
tokio-stream = "0.1.14" tokio-stream = "0.1.14"
tower = "0.4.13" tower = "0.4.13"
tower-http = { version = "0.4.3", features = ["trace"] } tower-http = { version = "0.4.3", features = ["trace"] }
once_cell = "1.18.0"

View File

@@ -1,3 +1,5 @@
use once_cell::sync::Lazy;
pub struct Config { pub struct Config {
pub telegram_bot_api: reqwest::Url, pub telegram_bot_api: reqwest::Url,
@@ -59,6 +61,6 @@ impl Config {
} }
} }
lazy_static! { pub static CONFIG: Lazy<Config> = Lazy::new(|| {
pub static ref CONFIG: Config = Config::load(); Config::load()
} });

View File

@@ -1,6 +1,3 @@
#[macro_use]
extern crate lazy_static;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc; use std::sync::Arc;