Skip to content

Commit 2653376

Browse files
bump chunk size
1 parent d6db418 commit 2653376

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

apps/desktop/src-tauri/src/upload.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@ use cap_project::{RecordingMeta, S3UploadMeta, UploadMeta};
1313
use cap_utils::spawn_actor;
1414
use ffmpeg::ffi::AV_TIME_BASE;
1515
use 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};
2118
use image::{ImageReader, codecs::jpeg::JpegEncoder};
2219
use reqwest::StatusCode;
2320
use serde::{Deserialize, Serialize};
2421
use specta::Type;
2522
use 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))]
6561
pub 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

Comments
 (0)