start on the feed checking code
This commit is contained in:
parent
c8ee7a0734
commit
bf11a10077
1 changed files with 17 additions and 5 deletions
22
src/lib.rs
22
src/lib.rs
|
|
@ -1,7 +1,4 @@
|
||||||
use std::{
|
use std::time::Duration;
|
||||||
//sync::{Arc, OnceLock},
|
|
||||||
time::Duration,
|
|
||||||
};
|
|
||||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||||
|
|
||||||
pub mod server;
|
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");
|
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 {
|
async fn get_db_pool() -> SqlitePool {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue