From f0e1d3ce6b99577b1fa4eb65b9bd9719df95891c Mon Sep 17 00:00:00 2001 From: JesusPerez Date: Sun, 12 Sep 2021 22:16:18 +0100 Subject: [PATCH] chore: fix paths --- src/clouds/on_clouds.rs | 6 ++++-- src/monitor.rs | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/clouds/on_clouds.rs b/src/clouds/on_clouds.rs index 7770de6..c58cf91 100644 --- a/src/clouds/on_clouds.rs +++ b/src/clouds/on_clouds.rs @@ -426,7 +426,7 @@ pub async fn create_cloud_config(reqname: &str,req_tsksrvcs: &str,reqenv: &ReqEn eprintln!("Error {} monitor_info {} -> {}",&entry,&cloud.env.monitor_run,e); String::from("") })); - } else { + } else if check_entries.len() > 0 && check_entries.len() < idx { cfg.monitor_info = check_entries[idx].monitor_info.to_owned(); } } @@ -442,8 +442,10 @@ pub async fn create_cloud_config(reqname: &str,req_tsksrvcs: &str,reqenv: &ReqEn if req_tsksrvcs.contains("liveness") { if no_check_entries { liveness = Some(on_cloud_name_req("liveness",&cloud,&reqenv,"","",&itm.path).await); - } else { + } else if check_entries.len() > 0 && check_entries.len() < idx { liveness = check_entries[idx].groups[grp_idx].items[itm_idx].liveness.to_owned(); + } else { + liveness = Some(String::from("")); } } else { liveness = itm.liveness.to_owned(); diff --git a/src/monitor.rs b/src/monitor.rs index 50d463e..9ba8fc0 100644 --- a/src/monitor.rs +++ b/src/monitor.rs @@ -184,7 +184,6 @@ pub fn run_on_selector(rule: &MonitorRule) -> Result { } } pub async fn run_monitor(monitor_rules: MonitorRules, _cloud: Cloud, _app_env: AppEnv) -> Result<()> { - // dbg!(&monitor_rules); println!("Run {}: {}",&monitor_rules.name,&monitor_rules.description); for (idx,rule) in monitor_rules.rules.iter().enumerate() { match rule.schedule.as_str() {