server: Load config for both run and mail

This commit is contained in:
Valentin Tolmer
2021-11-11 10:14:03 +01:00
committed by nitnelave
parent 77ced7ea43
commit 1d54ca8040
3 changed files with 97 additions and 33 deletions

View File

@@ -84,14 +84,13 @@ async fn run_server(config: Configuration) -> Result<()> {
}
fn run_server_command(opts: RunOpts) -> Result<()> {
let config = infra::configuration::init(opts.clone())?;
infra::logging::init(config.clone())?;
debug!("CLI: {:#?}", &opts);
let config = infra::configuration::init(opts)?;
infra::logging::init(&config)?;
info!("Starting LLDAP....");
debug!("CLI: {:#?}", opts);
debug!("Configuration: {:#?}", config);
actix::run(
run_server(config).unwrap_or_else(|e| error!("Could not bring up the servers: {:#}", e)),
)?;