diff options
Diffstat (limited to 'src/data/mod.rs')
-rw-r--r-- | src/data/mod.rs | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/data/mod.rs b/src/data/mod.rs index 1465fee..2be1f0a 100644 --- a/src/data/mod.rs +++ b/src/data/mod.rs @@ -1,13 +1,9 @@ use serde::{Deserialize, Serialize}; -#[cfg(feature = "ssr")] use tokio::sync::Mutex; use uuid::Uuid; -#[cfg(feature = "ssr")] use fs2::FileExt; -#[cfg(feature = "ssr")] use std::fs::File; -#[cfg(feature = "ssr")] use std::sync::LazyLock; use std::{collections::HashMap, path::Path, sync::Arc}; @@ -23,11 +19,9 @@ pub use page::{Page, Pages}; #[derive(Hash, PartialEq, Eq, Clone, Debug, Deserialize, Serialize)] pub struct PageUuid(Uuid); -#[cfg(feature = "ssr")] pub static CONFIG: LazyLock<Config> = LazyLock::new(|| Config::read_from_file().expect("Could not open config file")); -#[cfg(feature = "ssr")] static DATA_LOCK: LazyLock<StormscribeData> = LazyLock::new(|| { let config = &CONFIG; let lock_path = Path::join(&config.data_dir, ".lock"); @@ -53,7 +47,6 @@ static DATA_LOCK: LazyLock<StormscribeData> = LazyLock::new(|| { } }); -#[cfg(feature = "ssr")] pub struct StormscribeData { file_lock: File, data_snapshot: Mutex<Arc<DataSnapshot>>, @@ -71,7 +64,6 @@ pub struct PageData { content: String, } -#[cfg(feature = "ssr")] impl StormscribeData { async fn get_snapshot() -> Arc<DataSnapshot> { DATA_LOCK.data_snapshot.lock().await.clone() |