mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
### What problem does this PR solve? Fixes #15840. The Go HTTP server sets `WriteTimeout: 120s`, which also applies to long-lived SSE responses. Existing Go streaming handlers did not clear the per-response write deadline, so streams that run longer than the server timeout can be terminated mid-response. This PR adds a small handler helper that clears the response write deadline for SSE requests and calls it only in existing Go streaming branches: - conversation completion streaming - provider chat streaming - provider transcription streaming - provider speech streaming The global server `WriteTimeout` remains unchanged for non-streaming requests. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) ### Test plan - `/root/go/bin/go test ./internal/handler -run TestDisableWriteDeadlineForSSEAllowsLongLivedStream -count=1` - `/root/go/bin/go test ./internal/handler -count=1`
840 B
840 B