File tree Expand file tree Collapse file tree 4 files changed +7
-2
lines changed Expand file tree Collapse file tree 4 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ function deleteBucket() {
439
439
console . log ( err || data ) ;
440
440
} ) ;
441
441
}
442
-
442
+ return putObject ( ) ;
443
443
function putObject ( ) {
444
444
// 创建测试文件
445
445
var filename = '1mb.zip' ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " cos-nodejs-sdk-v5" ,
3
- "version" : " 2.4.15 " ,
3
+ "version" : " 2.4.16 " ,
4
4
"description" : " cos nodejs sdk v5" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -2202,6 +2202,9 @@ function _submitRequest(params, callback) {
2202
2202
if ( this . options . Proxy ) {
2203
2203
opt . proxy = this . options . Proxy ;
2204
2204
}
2205
+ if ( this . options . Timeout ) {
2206
+ opt . timeout = this . options . Timeout ;
2207
+ }
2205
2208
2206
2209
self . emit ( 'before-send' , opt ) ;
2207
2210
var sender = REQUEST ( opt ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ var defaultOptions = {
31
31
UseRawKey : false ,
32
32
UploadCheckContentMd5 : false ,
33
33
UploadIdCacheLimit : 500 ,
34
+ Timeout : 0 , // 单位毫秒,0 代表不设置超时时间
34
35
Proxy : '' ,
35
36
UserAgent : '' ,
36
37
} ;
@@ -46,6 +47,7 @@ var COS = function (options) {
46
47
this . options . CopyChunkSize = Math . max ( 1024 * 1024 , this . options . CopyChunkSize ) ;
47
48
this . options . CopySliceSize = Math . max ( 0 , this . options . CopySliceSize ) ;
48
49
this . options . MaxPartNumber = Math . max ( 1024 , Math . min ( 10000 , this . options . MaxPartNumber ) ) ;
50
+ this . options . Timeout = Math . max ( 0 , this . options . Timeout ) ;
49
51
if ( this . options . AppId ) {
50
52
console . warn ( 'warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").' ) ;
51
53
}
You can’t perform that action at this time.
0 commit comments