Skip to content

Commit

Permalink
fix(fetcher): entity too small on multipart upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotonQuantum committed Oct 12, 2023
1 parent f1b6cc1 commit d5004a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rsync-fetcher/src/rsync/uploader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ use crate::consts::UPLOAD_CONN;
use crate::rsync::file_list::FileEntry;
use crate::rsync::progress_display::ProgressDisplay;

const UPLOAD_CHUNK_SIZE: usize = 10 * 1024 * 1024;

pub struct Uploader {
rx: flume::Receiver<UploadTask>,
file_list: Arc<Vec<FileEntry>>,
Expand Down Expand Up @@ -135,10 +137,11 @@ impl Uploader {

let mut writer = content_disposition
.map_or_else(
|| self.s3.writer_with(&key),
|| self.s3.writer_with(&key).buffer(UPLOAD_CHUNK_SIZE),
|content_disposition| {
self.s3
.writer_with(&key)
.buffer(UPLOAD_CHUNK_SIZE)
.content_disposition(&content_disposition)
},
)
Expand Down

0 comments on commit d5004a1

Please sign in to comment.