fix is_post_seen
This commit is contained in:
parent
1bd19eff20
commit
4b421c6d4b
1 changed files with 2 additions and 2 deletions
|
@ -73,7 +73,7 @@ async fn main() -> Result<(), anyhow::Error> {
|
||||||
})
|
})
|
||||||
.expect("Error setting Ctrl-C handler");
|
.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.
|
// Run the scheduler in a separate thread.
|
||||||
let handle = run_scheduler(scheduler, running.clone());
|
let handle = run_scheduler(scheduler, running.clone());
|
||||||
|
@ -86,7 +86,7 @@ async fn main() -> Result<(), anyhow::Error> {
|
||||||
info!("Received post {:?}", news_post);
|
info!("Received post {:?}", news_post);
|
||||||
if news_post.is_complete() {
|
if news_post.is_complete() {
|
||||||
let title = news_post.title.clone().unwrap();
|
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;
|
redis_service.publish(&news_post).await;
|
||||||
info!("Published {:?}", news_post);
|
info!("Published {:?}", news_post);
|
||||||
redis_service.mark_post_seen(&title, 60 * 60 * 24 * 3).await;
|
redis_service.mark_post_seen(&title, 60 * 60 * 24 * 3).await;
|
||||||
|
|
Loading…
Reference in a new issue