File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -83,14 +83,6 @@ impl<N: Network> RobustSubscription<N> {
8383 "Subscription timeout - no block received, switching provider"
8484 ) ;
8585
86- // If we're on a fallback, force reconnect to primary
87- // before switching to the next fallback (bypassing reconnect interval)
88- if self . current_fallback_index . is_some ( ) &&
89- self . try_reconnect_to_primary ( true ) . await
90- {
91- continue ;
92- }
93-
9486 self . switch_to_fallback ( elapsed_err. into ( ) ) . await ?;
9587 }
9688 }
@@ -169,6 +161,11 @@ impl<N: Network> RobustSubscription<N> {
169161 }
170162
171163 async fn switch_to_fallback ( & mut self , last_error : Error ) -> Result < ( ) , Error > {
164+ // If we're on a fallback, try primary first before moving to next fallback
165+ if self . current_fallback_index . is_some ( ) && self . try_reconnect_to_primary ( true ) . await {
166+ return Ok ( ( ) ) ;
167+ }
168+
172169 if self . last_reconnect_attempt . is_none ( ) {
173170 self . last_reconnect_attempt = Some ( Instant :: now ( ) ) ;
174171 }
You can’t perform that action at this time.
0 commit comments