From 21cca6513bc1422c8432cf96c5a718b9e3bacffe Mon Sep 17 00:00:00 2001 From: chiyi Date: Thu, 9 Jul 2026 19:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8B=E8=BD=BD=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E5=BB=B6=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/provider/adobe/client.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/internal/provider/adobe/client.go b/backend/internal/provider/adobe/client.go index 38bb22a..bf7b58f 100644 --- a/backend/internal/provider/adobe/client.go +++ b/backend/internal/provider/adobe/client.go @@ -795,7 +795,14 @@ func (c *Client) pollVideo(ctx context.Context, sess *tlsSession, token, pollURL // asset is already produced at this point, so a transient network hiccup // (connection EOF/reset mid-body, S3 accelerate 5xx) must not fail the whole // generation — retry with backoff before giving up. -func (c *Client) download(ctx context.Context, sess *tlsSession, url string) ([]byte, error) { +const downloadTimeout = 3 * time.Minute + +func (c *Client) download(parent context.Context, sess *tlsSession, url string) ([]byte, error) { + // The artifact is already produced; detach from the (often nearly-elapsed) + // generation ctx deadline/cancel and give the download its own budget so a + // slow CDN read isn't killed mid-body and the backoff-retries can actually run. + ctx, cancel := context.WithTimeout(context.WithoutCancel(parent), downloadTimeout) + defer cancel() var data []byte var err error for _, wait := range []time.Duration{0, 1 * time.Second, 2 * time.Second, 5 * time.Second, 10 * time.Second} {