music sidecar: raise Bun.serve idleTimeout (blocking reindex outran 10s default)

The one-time v1→v2 full rebuild (and long range/SSE reads) take far longer than
Bun.serve's default 10s request idle-timeout, which dropped the triggering
request mid-flight ("request timed out after 10 seconds"). Set idleTimeout: 255
(Bun's max). A build that still outruns it completes in the background regardless
— a closed socket doesn't cancel the in-flight build promise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-27 15:08:26 +00:00
co-authored by Claude Opus 4.8
parent f408e4dd6f
commit 219f93a831
+4
View File
@@ -74,6 +74,10 @@ const port = getFreePort();
const server = Bun.serve({
port,
hostname: '127.0.0.1',
// A blocking /reindex (esp. the one-time full rebuild) and long range/SSE reads far outlast Bun's
// default 10s request idle-timeout, which would drop them mid-flight. 255s is Bun's max; a build that
// still outruns it completes in the background anyway (the promise isn't cancelled by a closed socket).
idleTimeout: 255,
async fetch(req) {
const url = new URL(req.url);
const json = (data: unknown, init?: ResponseInit) =>