From 93990307c47156eead4639b7e67d03364a660720 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sun, 7 May 2023 11:06:57 +0200 Subject: [PATCH] updated monitoring socket --- src/monitoring.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/monitoring.rs b/src/monitoring.rs index 59301d2..36f6404 100644 --- a/src/monitoring.rs +++ b/src/monitoring.rs @@ -36,8 +36,18 @@ pub async fn apiserver(ctxarc: &Arc>) -> io::Result<()> { .write_all(format!("{data}\n").as_bytes()) .await .unwrap(); - stream.flush().await.unwrap(); - stream.shutdown().await.unwrap(); + match stream.flush().await { + Ok(_) => {} + Err(e) => { + println!("error flushing stream: {e}") + } + } + match stream.shutdown().await { + Ok(_) => {} + Err(e) => { + println!("error shuting down stream: {e}") + } + } } Err(err) => { println!("unable to serialize data: {err}");