fix(reload): Store paths to config files for admin reload

Paths given via --config at startup 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:
Odd E. Ebbesen authored and Odd E. Ebbesen committed 2025-12-16 14:58:33 +00:00
1 parent 64e187e5b4
commit 867d0ab671
4 files changed
+42 -26

No files matched your search

+3 -8
View File
@@ -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))?;