Made watchdog less verbose
This commit is contained in:
@@ -17,7 +17,7 @@ use mwbot::{
|
||||
Bot,
|
||||
generators::{Generator, SortDirection, categories::CategoryMemberSort},
|
||||
};
|
||||
use std::{error::Error, path::Path};
|
||||
use std::path::Path;
|
||||
|
||||
use crate::watchdog::watch_wanted;
|
||||
|
||||
|
||||
@@ -11,11 +11,17 @@ pub async fn watch_wanted(bot: Bot) -> ! {
|
||||
let _enter = span.enter();
|
||||
|
||||
let mut ignored_ids = vec![];
|
||||
let mut watch_count = 0;
|
||||
loop {
|
||||
if ignored_ids.is_empty() {
|
||||
tracing::info!("Watchdog check...");
|
||||
} else {
|
||||
tracing::info!("Watchdog check [{} failed ids]...", ignored_ids.len());
|
||||
watch_count += 1;
|
||||
if watch_count >= 120 {
|
||||
watch_count = 0;
|
||||
let failed_id_info = if ignored_ids.is_empty() {
|
||||
String::new()
|
||||
} else {
|
||||
format!("[{} failed ids]", ignored_ids.len())
|
||||
};
|
||||
tracing::info!("Watchdog check{failed_id_info}...");
|
||||
}
|
||||
let wanted = wanted_ids(bot.clone()).await;
|
||||
let mut new_ignored = vec![];
|
||||
|
||||
Reference in New Issue
Block a user