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()