File tree 2 files changed +12
-10
lines changed
2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -844,7 +844,11 @@ pub trait ObjectStorage: Debug + Send + Sync + 'static {
844
844
let stream_relative_path = format ! ( "{stream_name}/{file_suffix}" ) ;
845
845
846
846
// Try uploading the file, handle potential errors without breaking the loop
847
- if let Err ( e) = self . upload_file ( & stream_relative_path, & path) . await {
847
+ // if let Err(e) = self.upload_multipart(key, path)
848
+ if let Err ( e) = self
849
+ . upload_multipart ( & RelativePathBuf :: from ( & stream_relative_path) , & path)
850
+ . await
851
+ {
848
852
error ! ( "Failed to upload file {filename:?}: {e}" ) ;
849
853
continue ; // Skip to the next file
850
854
}
Original file line number Diff line number Diff line change @@ -521,14 +521,6 @@ impl S3 {
521
521
522
522
let mut async_writer = self . client . put_multipart ( location) . await ?;
523
523
524
- // /* `abort_multipart()` has been removed */
525
- // let close_multipart = |err| async move {
526
- // error!("multipart upload failed. {:?}", err);
527
- // self.client
528
- // .abort_multipart(&key.into(), &multipart_id)
529
- // .await
530
- // };
531
-
532
524
let meta = file. metadata ( ) . await ?;
533
525
let total_size = meta. len ( ) as usize ;
534
526
if total_size < MIN_MULTIPART_UPLOAD_SIZE {
@@ -567,7 +559,13 @@ impl S3 {
567
559
568
560
// upload_parts.push(part_number as u64 + 1);
569
561
}
570
- async_writer. complete ( ) . await ?;
562
+ match async_writer. complete ( ) . await {
563
+ Ok ( _) => { } ,
564
+ Err ( err) => {
565
+ error ! ( "Failed to complete multipart upload. {:?}" , err) ;
566
+ async_writer. abort ( ) . await ?;
567
+ }
568
+ } ;
571
569
}
572
570
Ok ( ( ) )
573
571
}
You can’t perform that action at this time.
0 commit comments