File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ impl Builder<()> {
107
107
connector: None ,
108
108
read_your_writes: true ,
109
109
remote_writes: false ,
110
+ push_batch_size: 0 ,
110
111
} ,
111
112
}
112
113
}
@@ -524,6 +525,7 @@ cfg_sync! {
524
525
connector: Option <crate :: util:: ConnectorService >,
525
526
remote_writes: bool ,
526
527
read_your_writes: bool ,
528
+ push_batch_size: u32 ,
527
529
}
528
530
529
531
impl Builder <SyncedDatabase > {
@@ -543,6 +545,11 @@ cfg_sync! {
543
545
self
544
546
}
545
547
548
+ pub fn set_push_batch_size( mut self , v: u32 ) -> Builder <SyncedDatabase > {
549
+ self . inner. push_batch_size = v;
550
+ self
551
+ }
552
+
546
553
/// Provide a custom http connector that will be used to create http connections.
547
554
pub fn connector<C >( mut self , connector: C ) -> Builder <SyncedDatabase >
548
555
where
@@ -570,6 +577,7 @@ cfg_sync! {
570
577
connector,
571
578
remote_writes,
572
579
read_your_writes,
580
+ push_batch_size,
573
581
} = self . inner;
574
582
575
583
let path = path. to_str( ) . ok_or( crate :: Error :: InvalidUTF8Path ) ?. to_owned( ) ;
@@ -596,6 +604,10 @@ cfg_sync! {
596
604
)
597
605
. await ?;
598
606
607
+ if push_batch_size > 0 {
608
+ db. sync_ctx. as_ref( ) . unwrap( ) . lock( ) . await . set_push_batch_size( push_batch_size) ;
609
+ }
610
+
599
611
Ok ( Database {
600
612
db_type: DbType :: Offline {
601
613
db,
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ impl SyncContext {
120
120
Ok ( me)
121
121
}
122
122
123
+ pub fn set_push_batch_size ( & mut self , push_batch_size : u32 ) {
124
+ self . push_batch_size = push_batch_size;
125
+ }
126
+
123
127
#[ tracing:: instrument( skip( self ) ) ]
124
128
pub ( crate ) async fn pull_one_frame (
125
129
& mut self ,
You can’t perform that action at this time.
0 commit comments