Skip to content

Commit

Permalink
修改复制参数、任务增加 _custom 字段
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed May 27, 2019
1 parent 7e8a406 commit 00d04fc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
8 changes: 5 additions & 3 deletions dist/cos-js-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,7 @@ base.init(COS, task);
advance.init(COS, task);

COS.getAuthorization = util.getAuth;
COS.version = '0.5.16';
COS.version = '0.5.17';

module.exports = COS;

Expand Down Expand Up @@ -3707,6 +3707,7 @@ var initTask = function (cos) {
error: task.error
};
if (task.FilePath) t.FilePath = task.FilePath;
if (task._custom) t._custom = task._custom;
return t;
};

Expand Down Expand Up @@ -3839,7 +3840,8 @@ var initTask = function (cos) {
speed: 0,
percent: 0,
hashPercent: 0,
error: null
error: null,
_custom: params._custom
};
var onHashProgress = params.onHashProgress;
params.onHashProgress = function (info) {
Expand Down Expand Up @@ -11643,7 +11645,7 @@ function sliceCopyFile(params, callback) {
var SourceRegion = m[3];
var SourceKey = decodeURIComponent(m[4]);
var CopySliceSize = params.SliceSize === undefined ? self.options.CopySliceSize : params.SliceSize;
CopySliceSize = Math.max(0, Math.min(CopySliceSize, 5 * 1024 * 1024 * 1024));
CopySliceSize = Math.max(0, CopySliceSize);

var ChunkSize = params.ChunkSize || this.options.CopyChunkSize;
var ChunkParallel = this.options.CopyChunkParallelLimit;
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.5.16",
"version": "0.5.17",
"description": "JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/advance.js
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ function sliceCopyFile(params, callback) {
var SourceRegion = m[3];
var SourceKey = decodeURIComponent(m[4]);
var CopySliceSize = params.SliceSize === undefined ? self.options.CopySliceSize : params.SliceSize;
CopySliceSize = Math.max(0, Math.min(CopySliceSize, 5 * 1024 * 1024 * 1024));
CopySliceSize = Math.max(0, CopySliceSize);

var ChunkSize = params.ChunkSize || this.options.CopyChunkSize;
var ChunkParallel = this.options.CopyChunkParallelLimit;
Expand Down
2 changes: 1 addition & 1 deletion src/cos.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ base.init(COS, task);
advance.init(COS, task);

COS.getAuthorization = util.getAuth;
COS.version = '0.5.16';
COS.version = '0.5.17';

module.exports = COS;
2 changes: 2 additions & 0 deletions src/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var initTask = function (cos) {
error: task.error,
};
if (task.FilePath) t.FilePath = task.FilePath;
if (task._custom) t._custom = task._custom;
return t;
};

Expand Down Expand Up @@ -173,6 +174,7 @@ var initTask = function (cos) {
percent: 0,
hashPercent: 0,
error: null,
_custom: params._custom,
};
var onHashProgress = params.onHashProgress;
params.onHashProgress = function (info) {
Expand Down

0 comments on commit 00d04fc

Please sign in to comment.