start on the feed checking code

This commit is contained in:
Joe 2025-12-07 17:04:14 -08:00
parent c8ee7a0734
commit bf11a10077

View file

@ -1,7 +1,4 @@
use std::{
//sync::{Arc, OnceLock},
time::Duration,
};
use std::time::Duration;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
pub mod server;
@ -82,8 +79,23 @@ impl BlogdorTheAggregator {
}
}
async fn check_feeds(_db: &SqlitePool, _client: &Client) {
async fn check_feeds(db: &SqlitePool, _client: &Client) {
tracing::debug!("checking feeds");
let feeds = match sqlx::query!("select id, url from feeds where active = true")
.fetch_all(db)
.await
{
Ok(feeds) => feeds,
Err(e) => {
tracing::error!("got error fetching feeds from db: {e}");
return;
}
};
for feed in feeds {
let id = feed.id;
let url = feed.url;
}
}
async fn get_db_pool() -> SqlitePool {