We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1b6cc1 commit d5004a1Copy full SHA for d5004a1
rsync-fetcher/src/rsync/uploader.rs
@@ -23,6 +23,8 @@ use crate::consts::UPLOAD_CONN;
23
use crate::rsync::file_list::FileEntry;
24
use crate::rsync::progress_display::ProgressDisplay;
25
26
+const UPLOAD_CHUNK_SIZE: usize = 10 * 1024 * 1024;
27
+
28
pub struct Uploader {
29
rx: flume::Receiver<UploadTask>,
30
file_list: Arc<Vec<FileEntry>>,
@@ -135,10 +137,11 @@ impl Uploader {
135
137
136
138
let mut writer = content_disposition
139
.map_or_else(
- || self.s3.writer_with(&key),
140
+ || self.s3.writer_with(&key).buffer(UPLOAD_CHUNK_SIZE),
141
|content_disposition| {
142
self.s3
143
.writer_with(&key)
144
+ .buffer(UPLOAD_CHUNK_SIZE)
145
.content_disposition(&content_disposition)
146
},
147
)
0 commit comments