Skip to content

Commit d6928a6

Browse files
author
shsgear
committed
feat: 分片时输出提示
1 parent 5c2e7e8 commit d6928a6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎bin/index.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,17 @@ const upload = async (filePath, parts = []) =>{
115115

116116

117117

118-
constmerge=async()=>
119-
await_mergeAllChunks(requestUrl,{
118+
constmerge=async()=>{
119+
console.log(chalk.cyan('正在合并分片,请稍等...'))
120+
returnawait_mergeAllChunks(requestUrl,{
120121
version,
121122
uploadId,
122123
fileSize,
123124
fileTag: md5
124125
},{
125126
Authorization
126127
});
128+
}
127129

128130

129131
try{

‎lib/withRetry.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const withRetry = (fn, retryCount, retryDelay) => new Promise((resolve, reject)
1616
.catch((err)=>{
1717
if(retryCount>0){
1818
logger.error(err);
19-
console.log(chalk.cyan('遇到了一个小问题,重试中...'))
19+
console.log(chalk.red('合并分片遇到了一个小问题,重试中...'))
2020
returndelay(retryDelay)
2121
.then(withRetry.bind(null,fn,retryCount-1,retryDelay))
2222
.then(resolve)

0 commit comments

Comments
(0)