From fdcd44f9e3e802fc40693e4c4393dfbad0960a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8A=E5=9C=AD?= Date: Mon, 3 Aug 2026 16:53:17 +0800 Subject: [PATCH] fix: handle Ctrl+C (SIGINT) gracefully during drive download - Replace context.Background() with cmd.Context() in download and download-version commands so SIGINT propagates to download goroutines - Enables graceful interruption of multipart downloads via Ctrl+C --- internal/helpers/drive.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/helpers/drive.go b/internal/helpers/drive.go index 69b6968a..32feda63 100644 --- a/internal/helpers/drive.go +++ b/internal/helpers/drive.go @@ -509,7 +509,7 @@ func newDriveCommand() *cobra.Command { return nil } - ctx := context.Background() + ctx := cmd.Context() // Step 1: 获取下载 URL 和签名请求头 deps.Out.PrintInfo("[1/2] 获取下载链接...") @@ -600,7 +600,7 @@ func newDriveCommand() *cobra.Command { return nil } - ctx := context.Background() + ctx := cmd.Context() deps.Out.PrintInfo("[1/2] 获取历史版本下载链接...") dlArgsMap := map[string]any{ "nodeId": fileID,