From 4b421c6d4bef0bead1e90a1c67b08fa35c7c6601 Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Mon, 23 Dec 2024 15:01:27 +0200 Subject: [PATCH] fix is_post_seen --- scrapper/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scrapper/src/main.rs b/scrapper/src/main.rs index 1509203..8e5998f 100644 --- a/scrapper/src/main.rs +++ b/scrapper/src/main.rs @@ -73,7 +73,7 @@ async fn main() -> Result<(), anyhow::Error> { }) .expect("Error setting Ctrl-C handler"); - run_scrapping_job(&mut scheduler, tx, args.scrape_interval_minutes.minutes()); + run_scrapping_job(&mut scheduler, tx, 60.seconds()); // Run the scheduler in a separate thread. let handle = run_scheduler(scheduler, running.clone()); @@ -86,7 +86,7 @@ async fn main() -> Result<(), anyhow::Error> { info!("Received post {:?}", news_post); if news_post.is_complete() { let title = news_post.title.clone().unwrap(); - if redis_service.is_post_seen(&title).await { + if !redis_service.is_post_seen(&title).await { redis_service.publish(&news_post).await; info!("Published {:?}", news_post); redis_service.mark_post_seen(&title, 60 * 60 * 24 * 3).await;