@@ -320,7 +320,7 @@ class NamespaceGCP {
320
320
321
321
async create_object_upload ( params , object_sdk ) {
322
322
dbg . log0 ( 'NamespaceGCP.create_object_upload:' , this . bucket , inspect ( params ) ) ;
323
- const Tagging = params . tagging && params . tagging . map ( tag => tag . key + '=' + tag . value ) . join ( '&' ) ;
323
+ const tagging = params . tagging && params . tagging . map ( tag => tag . key + '=' + tag . value ) . join ( '&' ) ;
324
324
325
325
const res = await this . s3_client . send (
326
326
new CreateMultipartUploadCommand ( {
@@ -329,7 +329,7 @@ class NamespaceGCP {
329
329
ContentType : params . content_type ,
330
330
StorageClass : params . storage_class ,
331
331
Metadata : params . xattr ,
332
- Tagging
332
+ Tagging : tagging
333
333
} ) ) ;
334
334
335
335
dbg . log0 ( 'NamespaceGCP.create_object_upload:' , this . bucket , inspect ( params ) , 'res' , inspect ( res ) ) ;
@@ -353,39 +353,41 @@ class NamespaceGCP {
353
353
CopySourceRange : copy_source_range ,
354
354
} ) ) ;
355
355
etag = s3_utils . parse_etag ( res . CopyPartResult . ETag ) ;
356
- } else {
357
- let count = 1 ;
358
- const count_stream = stream_utils . get_tap_stream ( data => {
359
- this . stats ?. update_namespace_write_stats ( {
360
- namespace_resource_id : this . namespace_resource_id ,
361
- size : data . length ,
362
- count
363
- } ) ;
364
- // clear count for next updates
365
- count = 0 ;
356
+ return { etag } ;
357
+ }
358
+
359
+ let count = 1 ;
360
+ const count_stream = stream_utils . get_tap_stream ( data => {
361
+ this . stats ?. update_namespace_write_stats ( {
362
+ namespace_resource_id : this . namespace_resource_id ,
363
+ size : data . length ,
364
+ count
366
365
} ) ;
367
- try {
368
- res = await this . s3_client . send (
369
- new UploadPartCommand ( {
370
- Bucket : this . bucket ,
371
- Key : params . key ,
372
- UploadId : params . obj_id ,
373
- PartNumber : params . num ,
374
- Body : params . source_stream . pipe ( count_stream ) ,
375
- ContentMD5 : params . md5_b64 ,
376
- ContentLength : params . size ,
377
- } ) ) ;
378
- } catch ( err ) {
379
- fix_error_object ( err ) ;
380
- object_sdk . rpc_client . pool . update_issues_report ( {
381
- namespace_resource_id : this . namespace_resource_id ,
382
- error_code : String ( err . code ) ,
383
- time : Date . now ( ) ,
384
- } ) ;
385
- throw err ;
386
- }
387
- etag = s3_utils . parse_etag ( res . ETag ) ;
366
+ // clear count for next updates
367
+ count = 0 ;
368
+ } ) ;
369
+ try {
370
+ res = await this . s3_client . send (
371
+ new UploadPartCommand ( {
372
+ Bucket : this . bucket ,
373
+ Key : params . key ,
374
+ UploadId : params . obj_id ,
375
+ PartNumber : params . num ,
376
+ Body : params . source_stream . pipe ( count_stream ) ,
377
+ ContentMD5 : params . md5_b64 ,
378
+ ContentLength : params . size ,
379
+ } ) ) ;
380
+ } catch ( err ) {
381
+ fix_error_object ( err ) ;
382
+ object_sdk . rpc_client . pool . update_issues_report ( {
383
+ namespace_resource_id : this . namespace_resource_id ,
384
+ error_code : String ( err . code ) ,
385
+ time : Date . now ( ) ,
386
+ } ) ;
387
+ throw err ;
388
388
}
389
+ etag = s3_utils . parse_etag ( res . ETag ) ;
390
+
389
391
dbg . log0 ( 'NamespaceGCP.upload_multipart:' , this . bucket , inspect ( params ) , 'res' , inspect ( res ) ) ;
390
392
return { etag } ;
391
393
}
0 commit comments