tweak
This commit is contained in:
parent
9f8b6cb177
commit
2de9c744d7
2 changed files with 9 additions and 10 deletions
10
src/lib.rs
10
src/lib.rs
|
|
@ -9,7 +9,6 @@ use sqlx::{
|
||||||
};
|
};
|
||||||
use tokio::task::{JoinHandle, JoinSet};
|
use tokio::task::{JoinHandle, JoinSet};
|
||||||
use tokio_util::{bytes::Buf, sync::CancellationToken};
|
use tokio_util::{bytes::Buf, sync::CancellationToken};
|
||||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
|
||||||
use unicode_segmentation::UnicodeSegmentation;
|
use unicode_segmentation::UnicodeSegmentation;
|
||||||
|
|
||||||
pub mod server;
|
pub mod server;
|
||||||
|
|
@ -50,14 +49,6 @@ struct ZulipMessage<'s> {
|
||||||
|
|
||||||
impl BlogdorTheAggregator {
|
impl BlogdorTheAggregator {
|
||||||
pub async fn new() -> Self {
|
pub async fn new() -> Self {
|
||||||
tracing_subscriber::registry()
|
|
||||||
.with(
|
|
||||||
tracing_subscriber::EnvFilter::try_from_default_env()
|
|
||||||
.unwrap_or_else(|_| "blogdor=debug,axum=debug".into()),
|
|
||||||
)
|
|
||||||
.with(tracing_subscriber::fmt::layer())
|
|
||||||
.init();
|
|
||||||
|
|
||||||
let db = get_db_pool().await;
|
let db = get_db_pool().await;
|
||||||
let client = reqwest::Client::new(); // TODO: retries?
|
let client = reqwest::Client::new(); // TODO: retries?
|
||||||
let cancel = CancellationToken::new();
|
let cancel = CancellationToken::new();
|
||||||
|
|
@ -152,7 +143,6 @@ async fn check_feeds(db: &SqlitePool, client: &reqwest::Client) {
|
||||||
topic: Some(&post.title),
|
topic: Some(&post.title),
|
||||||
};
|
};
|
||||||
let msg = serde_urlencoded::to_string(msg).expect("serialize msg");
|
let msg = serde_urlencoded::to_string(msg).expect("serialize msg");
|
||||||
dbg!(&msg);
|
|
||||||
|
|
||||||
match client
|
match client
|
||||||
.post(&endpoint)
|
.post(&endpoint)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,16 @@
|
||||||
use blogdor::BlogdorTheAggregator;
|
use blogdor::BlogdorTheAggregator;
|
||||||
|
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||||
|
|
||||||
#[tokio::main(flavor = "multi_thread")]
|
#[tokio::main(flavor = "multi_thread")]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
|
tracing_subscriber::registry()
|
||||||
|
.with(
|
||||||
|
tracing_subscriber::EnvFilter::try_from_default_env()
|
||||||
|
.unwrap_or_else(|_| "blogdor=debug,axum=debug".into()),
|
||||||
|
)
|
||||||
|
.with(tracing_subscriber::fmt::layer())
|
||||||
|
.init();
|
||||||
|
|
||||||
let bta = BlogdorTheAggregator::new().await;
|
let bta = BlogdorTheAggregator::new().await;
|
||||||
let aggregator_handle = bta.aggregate().await;
|
let aggregator_handle = bta.aggregate().await;
|
||||||
let server_handle = bta.listen_http().await;
|
let server_handle = bta.listen_http().await;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue