fix: 25s backend timeout + 30s frontend timeout on Spotify resolve
Extracts resolve logic into _resolveSpotify() and wraps it in Promise.race with a 25s timer so the backend always sends a response even if undici's AbortSignal.timeout silently fails on blocked sockets. Also reduces frontend timeout from 90s to 30s. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
7d38fdf601
commit
76271c1e54
2 files changed
+40
-46
No files matched your search
+1
-1
@@ -63,7 +63,7 @@ export async function resolveSpotifyLink() {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ url }),
|
||||
signal: AbortSignal.timeout(90000),
|
||||
signal: AbortSignal.timeout(30000),
|
||||
});
|
||||
if (!res.ok) {
|
||||
const err = await res.json().catch(() => ({}));
|
||||
|
||||
Reference in new issue
Block a user