From 86fcca028cc12c098404ab3019f84c9805b7e544 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Tue, 10 Dec 2024 15:53:37 +0100 Subject: [PATCH] Only update matching listener status for last remote subscriber --- zenoh/src/api/session.rs | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/zenoh/src/api/session.rs b/zenoh/src/api/session.rs index 21144a4c7..a1df20f31 100644 --- a/zenoh/src/api/session.rs +++ b/zenoh/src/api/session.rs @@ -1574,21 +1574,31 @@ impl SessionInner { }, }), }); + #[cfg(feature = "unstable")] + { + let state = zread!(self.state); + self.update_matching_status( + &state, + &sub_state.key_expr, + MatchingStatusType::Subscribers, + false, + ) + } } else { drop(state); } } else { drop(state); - } - #[cfg(feature = "unstable")] - { - let state = zread!(self.state); - self.update_matching_status( - &state, - &sub_state.key_expr, - MatchingStatusType::Subscribers, - false, - ) + #[cfg(feature = "unstable")] + { + let state = zread!(self.state); + self.update_matching_status( + &state, + &sub_state.key_expr, + MatchingStatusType::Subscribers, + false, + ) + } } } SubscriberKind::LivelinessSubscriber => {