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() {
439439 console . log ( err || data ) ;
440440 } ) ;
441441}
442-
442+ return putObject ( ) ;
443443function putObject ( ) {
444444 // 创建测试文件
445445 var filename = '1mb.zip' ;
Original file line number Diff line number Diff line change 11{
22 "name" : " cos-nodejs-sdk-v5" ,
3- "version" : " 2.4.15 " ,
3+ "version" : " 2.4.16 " ,
44 "description" : " cos nodejs sdk v5" ,
55 "main" : " index.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -2202,6 +2202,9 @@ function _submitRequest(params, callback) {
22022202 if ( this . options . Proxy ) {
22032203 opt . proxy = this . options . Proxy ;
22042204 }
2205+ if ( this . options . Timeout ) {
2206+ opt . timeout = this . options . Timeout ;
2207+ }
22052208
22062209 self . emit ( 'before-send' , opt ) ;
22072210 var sender = REQUEST ( opt ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ var defaultOptions = {
3131 UseRawKey : false ,
3232 UploadCheckContentMd5 : false ,
3333 UploadIdCacheLimit : 500 ,
34+ Timeout : 0 , // 单位毫秒,0 代表不设置超时时间
3435 Proxy : '' ,
3536 UserAgent : '' ,
3637} ;
@@ -46,6 +47,7 @@ var COS = function (options) {
4647 this . options . CopyChunkSize = Math . max ( 1024 * 1024 , this . options . CopyChunkSize ) ;
4748 this . options . CopySliceSize = Math . max ( 0 , this . options . CopySliceSize ) ;
4849 this . options . MaxPartNumber = Math . max ( 1024 , Math . min ( 10000 , this . options . MaxPartNumber ) ) ;
50+ this . options . Timeout = Math . max ( 0 , this . options . Timeout ) ;
4951 if ( this . options . AppId ) {
5052 console . warn ( 'warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").' ) ;
5153 }
You can’t perform that action at this time.
0 commit comments