A decentralized music tracking and discovery platform built on AT Protocol 🎵
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: adjust mpsc channel size to 1 for DuckDB repo and enhance logging in save_scrobble function

+6 -3
+1 -1
crates/feed/src/repo/duckdb/mod.rs
··· 54 54 55 55 impl DuckdbRepo { 56 56 pub async fn new() -> Result<Self, Error> { 57 - let (save_tx, mut save_rx) = tokio::sync::mpsc::channel::<SaveMessage>(100); 57 + let (save_tx, mut save_rx) = tokio::sync::mpsc::channel::<SaveMessage>(1); 58 58 59 59 let conn = Arc::new(Mutex::new(duckdb::Connection::open(DB_PATH)?)); 60 60 let conn_clone = conn.clone();
+5 -2
crates/feed/src/repo/duckdb/scrobble.rs
··· 2 2 3 3 use anyhow::Error; 4 4 use duckdb::{params, OptionalExt}; 5 + use owo_colors::OwoColorize; 5 6 use std::sync::Mutex; 6 7 7 8 use crate::{did::did_to_profile, types::ScrobbleRecord}; ··· 335 336 record.created_at, 336 337 ], 337 338 ) { 338 - Ok(x) => tracing::info!("Scrobble inserted {}", x), 339 - Err(e) => tracing::error!(error = %e, "Error inserting scrobble"), 339 + Ok(x) => tracing::info!(title = %record.title.cyan(), "Scrobble inserted {}", x), 340 + Err(e) => { 341 + tracing::error!(title = %record.title.cyan(),error = %e, "Error inserting scrobble") 342 + } 340 343 } 341 344 342 345 tracing::info!("Scrobble insertion process completed for user: {}", did);