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

Wrap Spotify search in 5s timeout

+11 -2
+11 -2
crates/webscrobbler/src/scrobbler.rs
··· 138 138 139 139 tracing::info!(query = %query, "Searching on Spotify"); 140 140 141 - let result = 142 - retry_spotify_call(|| async { spotify_client.search(&query).await }, "search").await?; 141 + let result = retry_spotify_call( 142 + || async { 143 + tokio::time::timeout( 144 + std::time::Duration::from_secs(5), 145 + spotify_client.search(&query), 146 + ) 147 + .await? 148 + }, 149 + "search", 150 + ) 151 + .await?; 143 152 144 153 tracing::info!(total = %result.tracks.total, "Spotify search results"); 145 154