From 5b47d9d2572fae61c8597464ec7261b7aeda8073 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Mon, 10 Apr 2023 14:10:56 +0200 Subject: [PATCH] added error handling --- src/ipblc.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ipblc.rs b/src/ipblc.rs index d1a630e..469e5bf 100644 --- a/src/ipblc.rs +++ b/src/ipblc.rs @@ -68,7 +68,11 @@ pub async fn run() { hostname: gethostname(true), ipdata: ip_to_send, }; - send_to_ipbl_websocket(&mut wssocketrr, &ipe).await; + let status = send_to_ipbl_websocket(&mut wssocketrr, &ipe).await; + if !status { + ipeventws = Arc::clone(&ipeventtxarc); + wssocketrr = websocketinit(&ctxws, ipeventws).await; + } } continue }