File tree Expand file tree Collapse file tree 3 files changed +399
-61
lines changed
linera-core/src/client/requests_scheduler Expand file tree Collapse file tree 3 files changed +399
-61
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,21 @@ impl<N: Clone> InFlightTracker<N> {
173173 let peers = entry. alternative_peers . read ( ) . await ;
174174 Some ( peers. clone ( ) )
175175 }
176+
177+ /// Removes a specific peer from the alternative peers list.
178+ ///
179+ /// # Arguments
180+ /// - `key`: The request key to look up
181+ /// - `peer`: The peer to remove from alternatives
182+ pub ( super ) async fn remove_alternative_peer ( & self , key : & RequestKey , peer : & N )
183+ where
184+ N : PartialEq + Eq ,
185+ {
186+ if let Some ( entry) = self . entries . read ( ) . await . get ( key) {
187+ let mut alt_peers = entry. alternative_peers . write ( ) . await ;
188+ alt_peers. retain ( |p| p != peer) ;
189+ }
190+ }
176191}
177192
178193/// Type of in-flight request match found.
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ pub const CACHE_TTL_MS: u64 = 2000;
2121pub const CACHE_MAX_SIZE : usize = 1000 ;
2222pub const MAX_REQUEST_TTL_MS : u64 = 200 ;
2323pub const ALPHA_SMOOTHING_FACTOR : f64 = 0.1 ;
24+ pub const STAGGERED_DELAY_MS : u64 = 75 ;
2425
2526/// Configuration for the `RequestsScheduler`.
2627#[ derive( Debug , Clone ) ]
You can’t perform that action at this time.
0 commit comments