hunter/worker: don't pass host to save_post()

This commit is contained in:
Astro 2022-11-05 03:26:12 +01:00
parent 44a3d68201
commit 2fdd0e079b
2 changed files with 3 additions and 2 deletions

View File

@ -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")

View File

@ -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;
}