File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -106,22 +106,21 @@ impl<N: Network> RobustSubscription<N> {
106106 /// * If all providers have been exhausted and failed, returns the last attempt's error.
107107 pub async fn recv ( & mut self ) -> Result < N :: HeaderResponse , Error > {
108108 let subscription_timeout = self . robust_provider . subscription_timeout ;
109+
109110 loop {
110- let recv_result = timeout ( subscription_timeout, self . subscription . recv ( ) ) . await ;
111- match recv_result {
111+ match timeout ( subscription_timeout, self . subscription . recv ( ) ) . await {
112112 Ok ( Ok ( header) ) => {
113113 if self . is_on_fallback ( ) {
114114 self . try_reconnect_to_primary ( false ) . await ;
115115 }
116116 return Ok ( header) ;
117117 }
118118 Ok ( Err ( recv_error) ) => return Err ( recv_error. into ( ) ) ,
119- Err ( _ ) => {
119+ Err ( _elapsed ) => {
120120 warn ! (
121121 timeout_secs = subscription_timeout. as_secs( ) ,
122122 "Subscription timeout - no block received, switching provider"
123123 ) ;
124-
125124 self . switch_to_fallback ( CoreError :: Timeout ) . await ?;
126125 }
127126 }
You can’t perform that action at this time.
0 commit comments