From 070eae961a7ee4e27678180b772c0ff10f2b0b56 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 6 May 2024 22:36:17 +0200 Subject: [PATCH] Yet more logging and delay between series handling requests (should avoid potential rate limit) --- src/bot.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bot.rs b/src/bot.rs index 5a598f6..4dd40bc 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -102,6 +102,7 @@ pub(crate) async fn run() { let series = config.series.clone(); for series in series { + sleep(Duration::seconds(1).to_std().unwrap()).await; let info_msg = format!("Handling Series {}", series.slug); info!(info_msg); if handle_series(&series, &communities, &lemmy, &config, &mut post_history) @@ -122,7 +123,10 @@ async fn idle(start: &DateTime, config: &Config) { if Utc::now() - start > sleep_duration { sleep_duration = Duration::seconds(60); } - + + let info_msg = format!("Idling for {} seconds", sleep_duration); + info!(info_msg); + if let Some(status_url) = config.status_post_url.clone() { match reqwest::get(status_url).await { Ok(_) => {}