From 2f8b1ab418f57850989ae7a00b7a65f4b325baba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fern=C3=A1ndez?= Date: Wed, 15 Jan 2025 20:26:56 +0100 Subject: [PATCH] Break outer loop on exit --- src/monitor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monitor.rs b/src/monitor.rs index 5c91d89..c5de7ff 100644 --- a/src/monitor.rs +++ b/src/monitor.rs @@ -185,7 +185,7 @@ pub async fn monitor( // Main loop, receive any produced event and write it into the events log. - loop { + 'processor: loop { for message in &rx { match message { Ok(event) => { @@ -198,7 +198,7 @@ pub async fn monitor( }; if plain_path == "DISCONNECT" { info!("Received exit signal, exiting..."); - break; + break 'processor; } let event_path = Path::new(plain_path);