Skip to content

Commit

Permalink
ROVER-129 Fix up reading from channel
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jonathanrainer committed Aug 29, 2024
1 parent ee4df77 commit 44348e8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/command/dev/router/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 44348e8

Please sign in to comment.