A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
98
fork

Configure Feed

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

fix: adjust mpsc channel size and remove unnecessary sleep in scrobble synchronization

+2 -5
+1 -1
crates/feed/src/repo/duckdb/scrobble.rs
··· 1 - use std::sync::Arc; 1 + use std::{sync::Arc, thread::sleep}; 2 2 3 3 use anyhow::Error; 4 4 use duckdb::{params, OptionalExt};
+1 -4
crates/feed/src/sync.rs
··· 11 11 pub async fn sync_scrobbles(ddb: RepoImpl) -> Result<(), Error> { 12 12 tracing::info!("Starting scrobble synchronization..."); 13 13 14 - let (tx, mut rx) = tokio::sync::mpsc::channel::<PgRow>(500); 14 + let (tx, mut rx) = tokio::sync::mpsc::channel::<PgRow>(100); 15 15 16 16 let handle = tokio::spawn(async move { 17 17 let pool = PgPoolOptions::new() ··· 147 147 148 148 let repo = ddb.clone(); 149 149 repo.insert_scrobble(&did, &scrobble_uri, record).await?; 150 - 151 - // sleep a bit to avoid overwhelming the database 152 - tokio::time::sleep(std::time::Duration::from_millis(300)).await; 153 150 154 151 i += 1; 155 152 }