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
This commit is contained in:
1 parent
34c0c86a59
commit
fdcd44f9e3
1 file changed
+2
-2
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user