diff --git a/hunter/src/redis_store.rs b/hunter/src/redis_store.rs index 996c6f1..c15110c 100644 --- a/hunter/src/redis_store.rs +++ b/hunter/src/redis_store.rs @@ -2,7 +2,8 @@ use crate::feed::{Post, Tag}; const POST_EXPIRE: usize = 86400; -pub async fn save_post(man: &mut redis::aio::ConnectionManager, host: &str, post: Post) -> bool { +// TODO: make state obj w/ ConnectionManager +pub async fn save_post(man: &mut redis::aio::ConnectionManager, post: Post) -> bool { let post_key = format!("p:{}", post.uri); let check = redis::pipe() .getset(&post_key, "1") diff --git a/hunter/src/worker.rs b/hunter/src/worker.rs index 56429a2..9c4fdc8 100644 --- a/hunter/src/worker.rs +++ b/hunter/src/worker.rs @@ -57,7 +57,7 @@ pub fn fetch_and_process( // check if it's an actual post, not a repost if let Some(author_host) = post.account.host() { // send away to redis - if crate::redis_store::save_post(&mut redis_man, &host, post).await { + if crate::redis_store::save_post(&mut redis_man, post).await { new_posts += 1; }