config_path unwrapping mechanism

pull/19/head
prplV 2024-12-18 10:32:11 +03:00
parent 4fb3533074
commit 5a1588e256
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ fn load_processes(json_filename: &str) -> Option<Processes> {
pub async fn get_actual_config(params : Arc<PrebootParams>) -> Option<Processes> { pub async fn get_actual_config(params : Arc<PrebootParams>) -> Option<Processes> {
// * if no local conf -> loop and +inf getting conf from redis server // * if no local conf -> loop and +inf getting conf from redis server
// * if local conf -> once getting conf from redis server // * if local conf -> once getting conf from redis server
let config_path = params.config.to_str()?; let config_path = params.config.to_str().unwrap_or_else(|| {
error!("Invalid character in config file. Config path was set as default");
"settings.json"
});
info!("Configurating config module with params: no-remote-config={}, no-sub={}, local config path={:?}, remote server={}", params.no_remote_config, params.no_sub, params.config, params.remote_server_url); info!("Configurating config module with params: no-remote-config={}, no-sub={}, local config path={:?}, remote server={}", params.no_remote_config, params.no_sub, params.config, params.remote_server_url);
match load_processes(config_path) { match load_processes(config_path) {
Some(local_conf) => { Some(local_conf) => {