aboutsummaryrefslogtreecommitdiff
path: root/src/route.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/route.rs')
-rw-r--r--src/route.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/route.rs b/src/route.rs
index 285d049..032381d 100644
--- a/src/route.rs
+++ b/src/route.rs
@@ -16,17 +16,18 @@
// Copyright (C) 2022-2022 Fuwn <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only
-use std::{lazy::SyncLazy, sync::Mutex};
+use std::{collections::HashMap, lazy::SyncLazy, sync::Mutex};
use tokio::time::Instant;
-use crate::ROUTES;
-
#[cfg(debug_assertions)]
pub const CACHE_RATE: u64 = 1;
#[cfg(not(debug_assertions))]
pub const CACHE_RATE: u64 = 60 * 5;
+pub static ROUTES: SyncLazy<Mutex<HashMap<String, Route>>> =
+ SyncLazy::new(|| Mutex::new(HashMap::new()));
+
#[derive(Debug)]
pub struct Route {
pub description: String,