Skip to content

Commit

Permalink
分片大小参数容错
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Apr 9, 2018
1 parent 39954e7 commit ca65174
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dist/cos-js-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ util.extend(COS.prototype, base);
util.extend(COS.prototype, advance);

COS.getAuthorization = util.getAuth;
COS.version = '0.4.2';
COS.version = '0.4.3';

module.exports = COS;

Expand Down Expand Up @@ -8100,7 +8100,7 @@ function sliceUploadFile(params, callback) {
AutoChunkSize = SIZE[i] * 1024 * 1024;
if (FileSize / AutoChunkSize < 10000) break;
}
ChunkSize = Math.max(ChunkSize, AutoChunkSize);
params.ChunkSize = params.SliceSize = ChunkSize = Math.max(ChunkSize, AutoChunkSize);
})();

if (FileSize === 0) {
Expand Down Expand Up @@ -8385,7 +8385,7 @@ function uploadSliceList(params, cb) {
var UploadData = params.UploadData;
var FileSize = params.FileSize;
var SliceSize = params.SliceSize;
var ChunkParallel = params.AsyncLimit || self.options.ChunkParallelLimit || 1;
var ChunkParallel = Math.min(params.AsyncLimit || self.options.ChunkParallelLimit || 1, 256);
var Body = params.Body;
var SliceCount = Math.ceil(FileSize / SliceSize);
var FinishSize = 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/cos-js-sdk-v5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cos-js-sdk-v5",
"version": "0.4.2",
"version": "0.4.3",
"description": "cos js sdk v5",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/advance.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function sliceUploadFile(params, callback) {
AutoChunkSize = SIZE[i] * 1024 * 1024;
if (FileSize / AutoChunkSize < 10000) break;
}
ChunkSize = Math.max(ChunkSize, AutoChunkSize);
params.ChunkSize = params.SliceSize = ChunkSize = Math.max(ChunkSize, AutoChunkSize);
})();

if (FileSize === 0) {
Expand Down Expand Up @@ -398,7 +398,7 @@ function uploadSliceList(params, cb) {
var UploadData = params.UploadData;
var FileSize = params.FileSize;
var SliceSize = params.SliceSize;
var ChunkParallel = params.AsyncLimit || self.options.ChunkParallelLimit || 1;
var ChunkParallel = Math.min(params.AsyncLimit || self.options.ChunkParallelLimit || 1, 256);
var Body = params.Body;
var SliceCount = Math.ceil(FileSize / SliceSize);
var FinishSize = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/cos.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ util.extend(COS.prototype, base);
util.extend(COS.prototype, advance);

COS.getAuthorization = util.getAuth;
COS.version = '0.4.2';
COS.version = '0.4.3';

module.exports = COS;

0 comments on commit ca65174

Please sign in to comment.