tangled
alpha
login
or
join now
t1c.dev
/
rocksky
forked from
rocksky.app/rocksky
2
fork
atom
A decentralized music tracking and discovery platform built on AT Protocol 🎵
2
fork
atom
overview
issues
pulls
pipelines
Wrap Spotify search in 5s timeout
tsiry-sandratraina.com
1 month ago
92166a70
e4705e27
+11
-2
1 changed file
expand all
collapse all
unified
split
crates
webscrobbler
src
scrobbler.rs
+11
-2
crates/webscrobbler/src/scrobbler.rs
···
138
138
139
139
tracing::info!(query = %query, "Searching on Spotify");
140
140
141
141
-
let result =
142
142
-
retry_spotify_call(|| async { spotify_client.search(&query).await }, "search").await?;
141
141
+
let result = retry_spotify_call(
142
142
+
|| async {
143
143
+
tokio::time::timeout(
144
144
+
std::time::Duration::from_secs(5),
145
145
+
spotify_client.search(&query),
146
146
+
)
147
147
+
.await?
148
148
+
},
149
149
+
"search",
150
150
+
)
151
151
+
.await?;
143
152
144
153
tracing::info!(total = %result.tracks.total, "Spotify search results");
145
154