From 0fd663303cd29e8e2bc600f20b315d09e14173f4 Mon Sep 17 00:00:00 2001 From: lukasmittag Date: Fri, 12 Apr 2024 15:18:05 +0200 Subject: [PATCH] Refinement --- databroker/src/broker.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/databroker/src/broker.rs b/databroker/src/broker.rs index 05ca954b..df185ee0 100644 --- a/databroker/src/broker.rs +++ b/databroker/src/broker.rs @@ -669,7 +669,7 @@ impl Subscriptions { match &sub.permissions.expired() { Ok(()) => true, Err(PermissionError::Expired) => { - sub.sender = None; + info!("Token expired: removing subscription"); false } Err(err) => panic!("Error: {:?}", err), @@ -705,7 +705,6 @@ impl ChangeSubscription { // notify let notifications = { let mut notifications = EntryUpdates::default(); - let mut error = None; for (id, changed_fields) in changed { if let Some(fields) = self.entries.get(id) { if !fields.is_disjoint(changed_fields) { @@ -737,8 +736,7 @@ impl ChangeSubscription { } Err(ReadError::PermissionExpired) => { debug!("notify: token expired, closing subscription channel"); - error = Some(NotificationError {}); - break; + return Err(NotificationError {}) } Err(_) => { debug!("notify: could not find entry with id {}", id); @@ -747,9 +745,6 @@ impl ChangeSubscription { } } } - if let Some(err) = error { - return Err(err); - } notifications }; if notifications.updates.is_empty() {