From 944279f09f5be8eb6327ed72e537e636b42adf7a Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sun, 12 Feb 2023 22:42:39 +0100 Subject: [PATCH] rename to `connect_client_if_needed` --- kubi/src/networking.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kubi/src/networking.rs b/kubi/src/networking.rs index 7ef0678..fb8f53e 100644 --- a/kubi/src/networking.rs +++ b/kubi/src/networking.rs @@ -36,9 +36,11 @@ pub fn create_client( storages.add_unique(ClientJoinState::Disconnected); } -pub fn connect_client( +pub fn connect_client_if_needed( mut client: UniqueViewMut ) { + //NOTE: this used to be a condition function + //but that caused some issues for no reason if client.0.has_not_made_connection_attempts() { log::info!("Connect called"); client.0.connect().unwrap(); @@ -68,7 +70,7 @@ pub fn insert_client_events( pub fn update_networking() -> Workload { ( create_client.run_if_missing_unique::(), - connect_client, + connect_client_if_needed, update_client, insert_client_events, ).into_workload()