@@ -28,7 +28,7 @@ impl<IO: Io> Injector<IO> {
2828 capacity : buffer_capacity,
2929 tx : None ,
3030 max_tx_frame_no : 0 ,
31- previous_durable_frame_no : 0 ,
31+ previous_durable_frame_no : 0 ,
3232 } )
3333 }
3434
@@ -84,25 +84,29 @@ impl<IO: Io> Injector<IO> {
8484 if commit_data. is_some ( ) {
8585 self . max_tx_frame_no = 0 ;
8686 }
87- let buffer = current
88- . inject_frames ( buffer, commit_data, tx)
89- . await ?;
87+ let buffer = current. inject_frames ( buffer, commit_data, tx) . await ?;
9088 self . buffer = buffer;
9189 self . buffer . clear ( ) ;
9290 }
9391
9492 if size_after. is_some ( ) {
9593 let mut tx = self . tx . take ( ) . unwrap ( ) ;
96- self . wal . new_frame_notifier . send_replace ( last_committed_frame_no) ;
94+ self . wal
95+ . new_frame_notifier
96+ . send_replace ( last_committed_frame_no) ;
9797 // the strategy to swap the current log is to do it on change of durable boundary,
9898 // when we have caught up with the current durable frame_no
99- if self . current_durable ( ) != self . previous_durable_frame_no && self . current_durable ( ) >= self . max_tx_frame_no {
99+ if self . current_durable ( ) != self . previous_durable_frame_no
100+ && self . current_durable ( ) >= self . max_tx_frame_no
101+ {
100102 let wal = self . wal . clone ( ) ;
101103 // FIXME: tokio dependency here is annoying, we need an async version of swap_current.
102104 tokio:: task:: spawn_blocking ( move || {
103105 tx. commit ( ) ;
104106 wal. swap_current ( & tx)
105- } ) . await . unwrap ( ) ?
107+ } )
108+ . await
109+ . unwrap ( ) ?
106110 }
107111 }
108112 }
0 commit comments