From 6e6e07b1e7114bd0abcf177b4f927ac372de8158 Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Thu, 11 Jul 2024 10:40:16 +0200 Subject: [PATCH] do not send discord message on success --- src/rpcnode_check_alive.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/rpcnode_check_alive.rs b/src/rpcnode_check_alive.rs index 36c48ed..2f0a0ae 100644 --- a/src/rpcnode_check_alive.rs +++ b/src/rpcnode_check_alive.rs @@ -107,14 +107,16 @@ async fn main() -> ExitCode { assert!(tasks_total > 0, "no results"); - let discord_body = create_discord_message( - &rpcnode_label, - checks_enabled, - &mut tasks_success, - tasks_timedout, - success, - ); - send_webook_discord(discord_body).await; + if !success { + let discord_body = create_discord_message( + &rpcnode_label, + checks_enabled, + &mut tasks_success, + tasks_timedout, + success, + ); + send_webook_discord(discord_body).await; + } if !success { warn!(