Deduplicate Config reload logging
This commit is contained in:
parent
080b0bf4d8
commit
5ba963305c
1 changed files with 13 additions and 6 deletions
|
@ -69,7 +69,10 @@ pub(crate) async fn run(data: Arc<RwLock<SharedData>>) {
|
|||
Ok(data) => data,
|
||||
Err(e) => panic!("{}", e),
|
||||
};
|
||||
write.messages.push(Message::Info("Config reloaded".to_string()));
|
||||
let message = Message::Info("Config reloaded".to_string());
|
||||
if !write.messages.contains(&message) {
|
||||
write.messages.push(message);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,9 +105,12 @@ pub(crate) async fn run(data: Arc<RwLock<SharedData>>) {
|
|||
continue
|
||||
}
|
||||
};
|
||||
drop(read);
|
||||
let mut write = data.write().await;
|
||||
write.messages.push(Message::Info("Communities reloaded".to_string()));
|
||||
let message = Message::Info("Communities reloaded".to_string());
|
||||
if !read.messages.contains(&message) {
|
||||
drop(read);
|
||||
let mut write = data.write().await;
|
||||
write.messages.push(message);
|
||||
};
|
||||
last_reload = Utc::now();
|
||||
}
|
||||
}
|
||||
|
@ -199,10 +205,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()) {
|
||||
if !read.messages.contains(&Message::Info(format!("Skipping '{}' since already posted", post_lemmy_info.title))) {
|
||||
let message = Message::Info(format!("Skipping '{}' since already posted", post_lemmy_info.title));
|
||||
if !read.messages.contains(&message) {
|
||||
drop(read);
|
||||
let mut write = data.write().await;
|
||||
write.messages.push(Message::Info(format!("Skipping '{}' since already posted", post_lemmy_info.title)));
|
||||
write.messages.push(message);
|
||||
};
|
||||
post_list.remove(index);
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue