From 4cb22e630e026fcec405da5e4a6fa7f272e02230 Mon Sep 17 00:00:00 2001 From: Neshura Date: Sun, 17 Dec 2023 23:37:18 +0100 Subject: [PATCH] Remove excessive Info level Logging --- src/bot/mod.rs | 8 +++++--- src/main.rs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bot/mod.rs b/src/bot/mod.rs index 7c7bbbb..c5a1c47 100644 --- a/src/bot/mod.rs +++ b/src/bot/mod.rs @@ -199,9 +199,11 @@ async fn handle_series( { let read = data.read().await; if read.post_history.check_for_post(series.slug.as_str(), post_part_info.as_string().as_str(), post_lemmy_info.title.as_str()) { - drop(read); - let mut write = data.write().await; - write.messages.push(Message::Info(format!("Skipping '{}' since already posted", post_lemmy_info.title))); + if !read.messages.contains(&Message::Info(format!("Skipping '{}' since already posted", post_lemmy_info.title))) { + drop(read); + let mut write = data.write().await; + write.messages.push(Message::Info(format!("Skipping '{}' since already posted", post_lemmy_info.title))); + }; post_list.remove(index); continue } diff --git a/src/main.rs b/src/main.rs index 552bc0f..3bdb4d8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,7 +62,7 @@ impl SharedData { } } -#[derive(Clone, Debug, Display)] +#[derive(Clone, Debug, Display, PartialEq)] pub(crate) enum Message { Info(String), Warning(String),