mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix(reload): WIP - store paths to config files
Paths given via --config are now stored inside the config struct at runtime, to make it possible to reload config without setting an env var for the config file location.
This commit is contained in:
+3
-8
@@ -1,4 +1,4 @@
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit_core::{
|
||||
Error, Result,
|
||||
@@ -38,14 +38,9 @@ impl Server {
|
||||
) -> Result<Arc<Self>, Error> {
|
||||
let _runtime_guard = runtime.map(runtime::Handle::enter);
|
||||
|
||||
let config_paths = args
|
||||
.config
|
||||
.as_deref()
|
||||
.into_iter()
|
||||
.flat_map(<[_]>::iter)
|
||||
.map(PathBuf::as_path);
|
||||
let config_paths = args.config.clone().unwrap_or_default();
|
||||
|
||||
let config = Config::load(config_paths)
|
||||
let config = Config::load(&config_paths)
|
||||
.and_then(|raw| update(raw, args))
|
||||
.and_then(|raw| Config::new(&raw))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user