This commit is contained in:
Ara Sadoyan
2026-06-03 16:37:56 +02:00
parent 4a6e1d817b
commit 3c99ed0c44
7 changed files with 28 additions and 19 deletions
+11
View File
@@ -0,0 +1,11 @@
use dashmap::DashMap;
use moka::sync::Cache;
use pingora_limits::rate::Rate;
use std::net::IpAddr;
use std::sync::{Arc, LazyLock};
use std::time::Duration;
pub static REVERSE_STORE: LazyLock<DashMap<String, String>> = LazyLock::new(DashMap::new);
pub static RATE_LIMITER: LazyLock<Rate> = LazyLock::new(|| Rate::new(Duration::from_secs(1)));
pub static REQUESTS_4XX: LazyLock<Cache<IpAddr, u32>> = LazyLock::new(|| Cache::builder().time_to_live(Duration::from_secs(1)).build());
pub static LOCALHOST: LazyLock<Arc<str>> = LazyLock::new(|| Arc::from("localhost"));