From 44348e83fab243a7fadc433e3dd7b8c338bcff07 Mon Sep 17 00:00:00 2001 From: jonathanrainer Date: Wed, 28 Aug 2024 16:18:25 +0100 Subject: [PATCH] ROVER-129 Fix up reading from channel Because we're now using `tokio` channels they return None when they are empty. So we can use a different idiom to read from them, which ensures this continues to work. --- src/command/dev/router/config.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/command/dev/router/config.rs b/src/command/dev/router/config.rs index f6e9bd504f..d8cb8be0a6 100644 --- a/src/command/dev/router/config.rs +++ b/src/command/dev/router/config.rs @@ -269,12 +269,8 @@ impl RouterConfigReader { let (state_tx, state_rx) = unbounded(); Fs::watch_file(input_config_path, raw_tx); tokio::spawn(async move { - loop { - raw_rx - .recv() - .await - .expect("could not watch router configuration file") - .expect("could not watch router configuration file"); + while let Some(res) = raw_rx.recv().await { + res.expect("could not watch router configuration file"); if let Ok(results) = self.read().map_err(log_err_and_continue) { state_tx .send(results)