@@ -13,18 +13,14 @@ use cap_project::{RecordingMeta, S3UploadMeta, UploadMeta};
1313use cap_utils:: spawn_actor;
1414use ffmpeg:: ffi:: AV_TIME_BASE ;
1515use flume:: Receiver ;
16- use futures:: {
17- FutureExt , Stream , StreamExt , TryStreamExt ,
18- stream:: { self , FuturesOrdered } ,
19- } ;
20- use futures:: { future:: join, stream:: FuturesUnordered } ;
16+ use futures:: future:: join;
17+ use futures:: { Stream , StreamExt , TryStreamExt , stream} ;
2118use image:: { ImageReader , codecs:: jpeg:: JpegEncoder } ;
2219use reqwest:: StatusCode ;
2320use serde:: { Deserialize , Serialize } ;
2421use specta:: Type ;
2522use std:: {
2623 collections:: HashMap ,
27- future:: Ready ,
2824 io,
2925 path:: { Path , PathBuf } ,
3026 pin:: pin,
@@ -58,8 +54,8 @@ pub struct UploadProgressEvent {
5854 total : String ,
5955}
6056
61- // a typical recommended chunk size is 5MB (AWS min part size).
62- const CHUNK_SIZE : u64 = 5 * 1024 * 1024 ; // 5MB
57+ // The size of each S3 multipart upload chunk
58+ const CHUNK_SIZE : u64 = 20 * 1024 * 1024 ; // 20 MB
6359
6460#[ instrument( skip( app, channel, file_path, screenshot_path) ) ]
6561pub async fn upload_video (
@@ -764,12 +760,10 @@ fn multipart_uploader(
764760 ( stream, expected_part_number + 1 ) ,
765761 ) )
766762 }
767- // .instrument(Span::current())
768763 } ,
769764 )
770765 . buffered ( MAX_CONCURRENT_UPLOADS )
771766 . boxed ( )
772- // .instrument(Span::current())
773767 } )
774768 . chain ( stream:: once ( async move {
775769 debug ! (
0 commit comments