Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
[databroker] Update calls to subscribe
Browse files Browse the repository at this point in the history
Internal subscribe function signature was modified and not all call
sites got updated.
  • Loading branch information
argerus authored and erikbosch committed Oct 25, 2023
1 parent 260c87c commit 170ed8b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions kuksa_databroker/databroker/src/viss/v2/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,18 @@ impl Viss for Server {
})?;
let broker = self.broker.authorized_access(&permissions);

let entries = HashMap::from([(
Into::<String>::into(request.path),
HashSet::from([broker::Field::Datapoint]),
)]);
let Some(entries) = broker
.get_id_by_path(request.path.as_ref())
.await
.map(|id| HashMap::from([(id, HashSet::from([broker::Field::Datapoint]))]))
else {
return Err(SubscribeErrorResponse {
request_id,
error: Error::NotFoundInvalidPath,
ts: SystemTime::now().into(),
});
};

match broker.subscribe(entries).await {
Ok(stream) => {
let subscription_id = SubscriptionId::new();
Expand Down

0 comments on commit 170ed8b

Please sign in to comment.