File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
coprocessor/fhevm-engine/host-listener/src/cmd Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -328,10 +328,21 @@ impl InfiniteLogIter {
328328 let config = websocket_config ( ) ;
329329 let ws = WsConnect :: new ( & self . url )
330330 . with_config ( config)
331- . with_max_retries ( 0 ) ; // disabled, alloy skips events
332- let provider = match ProviderBuilder :: new ( ) . connect_ws ( ws) . await {
333- Ok ( provider) => provider,
334- Err ( _) => anyhow:: bail!( "Cannot get a provider" ) ,
331+ // disabled, retried explicitly later
332+ . with_max_retries ( 0 ) ;
333+ // Timeout to prevent slow reconnection
334+ let provider = tokio:: time:: timeout (
335+ Duration :: from_secs ( self . timeout_request_websocket ) ,
336+ ProviderBuilder :: new ( ) . connect_ws ( ws) ,
337+ ) ;
338+ let provider = match provider. await {
339+ Err ( _) => {
340+ anyhow:: bail!( "Timeout getting provider for logs range" )
341+ }
342+ Ok ( Err ( err) ) => {
343+ anyhow:: bail!( "Cannot get provider for logs range due to {err}" )
344+ }
345+ Ok ( Ok ( provider) ) => provider,
335346 } ;
336347 // Timeout to prevent hanging indefinitely on buggy node
337348 match tokio:: time:: timeout (
You can’t perform that action at this time.
0 commit comments