Skip to content

Commit 5ba72af

Browse files
authored
Merge pull request #268 from GuGaobai1994/master
fix an issue resumeUploader failed when the last chunk is less than 2056
2 parents ed3e977 + a279555 commit 5ba72af

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

qiniu/storage/resume.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function putReq(config, uploadToken, key, rsStream, rsStreamLen, putExtra,
181181
}
182182

183183
rsStream.resume();
184-
if (isEnd) {
184+
if (isEnd || finishedCtxList.length === Math.floor(totalBlockNum)) {
185185
mkfileReq(upDomain, uploadToken, fileSize, finishedCtxList, key, putExtra, callbackFunc);
186186
}
187187
}
@@ -191,13 +191,13 @@ function putReq(config, uploadToken, key, rsStream, rsStreamLen, putExtra,
191191
});
192192

193193
//check when to mkfile
194-
rsStream.on('end', function() {
195-
//console.log("end");
196-
if (!isEnd) {
197-
mkfileReq(upDomain, uploadToken, fileSize, finishedCtxList, key,
198-
putExtra, callbackFunc);
199-
}
200-
});
194+
// rsStream.on('end', function() {
195+
// //console.log("end");
196+
// if (!isEnd) {
197+
// console.log("end");
198+
// mkfileReq(upDomain, uploadToken, fileSize, finishedCtxList, key,
199+
// putExtra, callbackFunc)}
200+
// });
201201
}
202202

203203
function mkblkReq(upDomain, uploadToken, blkData, callbackFunc) {

0 commit comments

Comments
 (0)