Skip to content

Commit d5004a1

Browse files
committed
fix(fetcher): entity too small on multipart upload
1 parent f1b6cc1 commit d5004a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rsync-fetcher/src/rsync/uploader.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ use crate::consts::UPLOAD_CONN;
2323
use crate::rsync::file_list::FileEntry;
2424
use crate::rsync::progress_display::ProgressDisplay;
2525

26+
const UPLOAD_CHUNK_SIZE: usize = 10 * 1024 * 1024;
27+
2628
pub struct Uploader {
2729
rx: flume::Receiver<UploadTask>,
2830
file_list: Arc<Vec<FileEntry>>,
@@ -135,10 +137,11 @@ impl Uploader {
135137

136138
let mut writer = content_disposition
137139
.map_or_else(
138-
|| self.s3.writer_with(&key),
140+
|| self.s3.writer_with(&key).buffer(UPLOAD_CHUNK_SIZE),
139141
|content_disposition| {
140142
self.s3
141143
.writer_with(&key)
144+
.buffer(UPLOAD_CHUNK_SIZE)
142145
.content_disposition(&content_disposition)
143146
},
144147
)

0 commit comments

Comments
 (0)