mirror of
https://github.com/mikedilger/chorus.git
synced 2026-01-03 06:15:33 +00:00
GLOBALS.filestore
This commit is contained in:
parent
8b90d83dd5
commit
d526f103c7
@ -31,6 +31,11 @@ async fn main() -> Result<(), Error> {
|
||||
let store = chorus::setup_store(&config)?;
|
||||
let _ = GLOBALS.store.set(store);
|
||||
|
||||
if let Some(ref blossom_directory) = config.blossom_directory {
|
||||
let filestore = chorus::filestore::FileStore::new(blossom_directory).await?;
|
||||
let _ = GLOBALS.filestore.set(filestore);
|
||||
}
|
||||
|
||||
// TLS setup
|
||||
let maybe_tls_acceptor = if config.use_tls {
|
||||
log::info!(target: "Server", "Using TLS");
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
use crate::config::Config;
|
||||
use crate::filestore::FileStore;
|
||||
use crate::ip::HashedIp;
|
||||
use dashmap::DashMap;
|
||||
use hyper::server::conn::http1;
|
||||
@ -18,6 +19,7 @@ pub struct Globals {
|
||||
pub bytes_outbound: AtomicU64,
|
||||
pub config: RwLock<Config>,
|
||||
pub store: OnceLock<Store>,
|
||||
pub filestore: OnceLock<FileStore>,
|
||||
pub http1builder: http1::Builder,
|
||||
pub rid: OnceLock<String>,
|
||||
|
||||
@ -48,6 +50,7 @@ lazy_static! {
|
||||
bytes_outbound: AtomicU64::new(0),
|
||||
config: RwLock::new(Default::default()),
|
||||
store: OnceLock::new(),
|
||||
filestore: OnceLock::new(),
|
||||
http1builder,
|
||||
rid: OnceLock::new(),
|
||||
new_events,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user