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;
19
19
const METADATA_VERSION : u32 = 0 ;
20
20
21
21
const DEFAULT_MAX_RETRIES : usize = 5 ;
22
+ const DEFAULT_PUSH_BATCH_SIZE : u32 = 128 ;
22
23
23
24
#[ derive( thiserror:: Error , Debug ) ]
24
25
#[ non_exhaustive]
@@ -74,6 +75,7 @@ pub struct SyncContext {
74
75
sync_url : String ,
75
76
auth_token : Option < HeaderValue > ,
76
77
max_retries : usize ,
78
+ push_batch_size : u32 ,
77
79
/// The current durable generation.
78
80
durable_generation : u32 ,
79
81
/// Represents the max_frame_no from the server.
@@ -102,6 +104,7 @@ impl SyncContext {
102
104
sync_url,
103
105
auth_token,
104
106
max_retries : DEFAULT_MAX_RETRIES ,
107
+ push_batch_size : DEFAULT_PUSH_BATCH_SIZE ,
105
108
client,
106
109
durable_generation : 1 ,
107
110
durable_frame_num : 0 ,
@@ -538,7 +541,7 @@ async fn try_push(
538
541
539
542
let mut frame_no = start_frame_no;
540
543
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 ) ;
542
545
let mut frames = conn. wal_get_frame ( frame_no, page_size) ?;
543
546
if batch_size > 1 {
544
547
frames. reserve ( ( batch_size - 1 ) as usize * frames. len ( ) ) ;
You can’t perform that action at this time.
0 commit comments