caretta-sync/lazy-supplements/src/global/mod.rs

17 lines
408 B
Rust
Raw Normal View History

2025-05-25 17:19:37 +09:00
use crate::config::{ServerConfig};
use sea_orm::DatabaseConnection;
use tokio::sync::OnceCell;
mod database;
pub static GLOBAL: Global = Global{
server_config: OnceCell::const_new(),
database: OnceCell::const_new(),
};
pub struct Global {
server_config: OnceCell<ServerConfig>,
database: OnceCell<DatabaseConnection>,
}
2025-05-27 17:49:52 +09:00
2025-05-27 17:58:32 +09:00
#[cfg(test)]
2025-05-27 17:49:52 +09:00
pub use database::tests::get_or_init_temporary_database;