File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ pub mod transaction;
1919const METADATA_VERSION : u32 = 0 ;
2020
2121const DEFAULT_MAX_RETRIES : usize = 5 ;
22+ const DEFAULT_PUSH_BATCH_SIZE : u32 = 128 ;
2223
2324#[ derive( thiserror:: Error , Debug ) ]
2425#[ non_exhaustive]
@@ -74,6 +75,7 @@ pub struct SyncContext {
7475 sync_url : String ,
7576 auth_token : Option < HeaderValue > ,
7677 max_retries : usize ,
78+ push_batch_size : u32 ,
7779 /// The current durable generation.
7880 durable_generation : u32 ,
7981 /// Represents the max_frame_no from the server.
@@ -102,6 +104,7 @@ impl SyncContext {
102104 sync_url,
103105 auth_token,
104106 max_retries : DEFAULT_MAX_RETRIES ,
107+ push_batch_size : DEFAULT_PUSH_BATCH_SIZE ,
105108 client,
106109 durable_generation : 1 ,
107110 durable_frame_num : 0 ,
@@ -538,7 +541,7 @@ async fn try_push(
538541
539542 let mut frame_no = start_frame_no;
540543 while frame_no <= end_frame_no {
541- let batch_size = 128 . min ( end_frame_no - frame_no + 1 ) ;
544+ let batch_size = sync_ctx . push_batch_size . min ( end_frame_no - frame_no + 1 ) ;
542545 let mut frames = conn. wal_get_frame ( frame_no, page_size) ?;
543546 if batch_size > 1 {
544547 frames. reserve ( ( batch_size - 1 ) as usize * frames. len ( ) ) ;
You can’t perform that action at this time.
0 commit comments