Skip to content

Commit

Permalink
decreases the part for when the kuksa client is locked in the zenoh-k…
Browse files Browse the repository at this point in the history
…uksa-provider
  • Loading branch information
eriksven committed Oct 18, 2024
1 parent 565e6f2 commit 545bd99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions zenoh-kuksa-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
########################################################################


[workspace]

[package]
name = "zenoh-kuksa-provider"
version = "0.1.0"
Expand Down
4 changes: 2 additions & 2 deletions zenoh-kuksa-provider/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ async fn handling_zenoh_subscribtion(
) {
info!("Listening on selector: {:?}", provider_config.zenoh.key_exp);

let mut sub_client = kuksa_client.lock().await;

let provider_config_clone = Arc::clone(&provider_config);
let subscriber = session
.declare_subscriber(provider_config_clone.zenoh.key_exp.clone())
Expand All @@ -79,11 +77,13 @@ async fn handling_zenoh_subscribtion(
if field_type == "currentValue" {
let datapoint_update = new_datapoint_for_update(&vss_path, &sample, &store);

let mut sub_client = kuksa_client.lock().await;
debug!("Forwarding: {:#?}", datapoint_update);
sub_client
.set_current_values(datapoint_update)
.await
.unwrap();
drop(sub_client);
}
}
}
Expand Down

0 comments on commit 545bd99

Please sign in to comment.