Parcourir la source

fix(hermes): add else to select! to loop cleanly

Reisen il y a 1 an
Parent
commit
c74b34b382
2 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 2 1
      apps/hermes/src/network/pythnet.rs
  2. 2 1
      apps/hermes/src/network/wormhole.rs

+ 2 - 1
apps/hermes/src/network/pythnet.rs

@@ -291,7 +291,8 @@ pub async fn spawn(opts: RunOptions, state: Arc<State>) -> Result<()> {
                             tracing::error!("Pythnet listener restarting too quickly. Sleep 1s.");
                             tokio::time::sleep(Duration::from_secs(1)).await;
                         }
-                    }
+                    },
+                    else => {}
                 }
             }
             tracing::info!("Shutting down Pythnet listener...");

+ 2 - 1
apps/hermes/src/network/wormhole.rs

@@ -162,7 +162,8 @@ pub async fn spawn(opts: RunOptions, state: Arc<State>) -> Result<()> {
             _ = exit.changed() => break,
             Err(err) = run(opts.clone(), state.clone()) => {
                 tracing::error!(error = ?err, "Wormhole gRPC service failed.");
-            }
+            },
+            else => {}
         }
     }
     tracing::info!("Shutting down Wormhole gRPC service...");