Skip to content

Commit 0fd6633

Browse files
committed
Refinement
1 parent 942bbf0 commit 0fd6633

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

databroker/src/broker.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ impl Subscriptions {
669669
match &sub.permissions.expired() {
670670
Ok(()) => true,
671671
Err(PermissionError::Expired) => {
672-
sub.sender = None;
672+
info!("Token expired: removing subscription");
673673
false
674674
}
675675
Err(err) => panic!("Error: {:?}", err),
@@ -705,7 +705,6 @@ impl ChangeSubscription {
705705
// notify
706706
let notifications = {
707707
let mut notifications = EntryUpdates::default();
708-
let mut error = None;
709708
for (id, changed_fields) in changed {
710709
if let Some(fields) = self.entries.get(id) {
711710
if !fields.is_disjoint(changed_fields) {
@@ -737,8 +736,7 @@ impl ChangeSubscription {
737736
}
738737
Err(ReadError::PermissionExpired) => {
739738
debug!("notify: token expired, closing subscription channel");
740-
error = Some(NotificationError {});
741-
break;
739+
return Err(NotificationError {})
742740
}
743741
Err(_) => {
744742
debug!("notify: could not find entry with id {}", id);
@@ -747,9 +745,6 @@ impl ChangeSubscription {
747745
}
748746
}
749747
}
750-
if let Some(err) = error {
751-
return Err(err);
752-
}
753748
notifications
754749
};
755750
if notifications.updates.is_empty() {

0 commit comments

Comments
 (0)