Skip to content

Commit

Permalink
fix: downloadFile 在 windows 中偶现文件被锁定 (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
livehigh authored Jun 26, 2024
1 parent d7c55da commit 4d86e6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cos-nodejs-sdk-v5",
"version": "2.14.1",
"version": "2.14.2",
"description": "cos nodejs sdk v5",
"main": "index.js",
"types": "index.d.ts",
Expand Down
3 changes: 3 additions & 0 deletions sdk/advance.js
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,9 @@ function downloadFile(params, callback) {
Output: writeStream,
},
function (err, data) {
if (err && writeStream.writableFinished === false) {
writeStream.close && writeStream.close();
}
if (aborted) return;

// 处理错误和进度
Expand Down

0 comments on commit 4d86e6c

Please sign in to comment.