fix: stop stale request retries

This commit is contained in:
2026-06-18 20:25:30 +02:00
committed by Milas Holsting
parent aed61b8b61
commit 9e0f2231b5
5 changed files with 50 additions and 5 deletions

View File

@@ -48,6 +48,9 @@ func (h *PlaybackHandler) HandleProxyStream(c *gin.Context) {
copyProxyHeaders(c.Writer.Header(), resp.Header)
c.Status(resp.StatusCode)
if n, err := io.Copy(c.Writer, resp.Body); err != nil {
if errors.Is(err, context.Canceled) || c.Request.Context().Err() != nil {
return
}
observability.WarnContext(c.Request.Context(), "proxy_stream_copy_failed", "playback", "", map[string]any{"target_url": targetURL, "bytes_copied": n}, err)
}
}