@@ -607,7 +607,7 @@ impl Subscriptions {
607
607
}
608
608
609
609
pub async fn notify (
610
- & mut self ,
610
+ & self ,
611
611
changed : Option < & HashMap < i32 , HashSet < Field > > > ,
612
612
db : & Database ,
613
613
) -> Result < Option < HashMap < String , ( ) > > , NotificationError > {
@@ -627,7 +627,7 @@ impl Subscriptions {
627
627
}
628
628
}
629
629
630
- for sub in & mut self . change_subscriptions {
630
+ for sub in & self . change_subscriptions {
631
631
match sub. notify ( changed, db) . await {
632
632
Ok ( _) => { }
633
633
Err ( err) => error = Some ( err) ,
@@ -660,7 +660,7 @@ impl Subscriptions {
660
660
true
661
661
}
662
662
} ) ;
663
- self . change_subscriptions . retain_mut ( |sub| {
663
+ self . change_subscriptions . retain ( |sub| {
664
664
if sub. sender . is_closed ( ) {
665
665
info ! ( "Subscriber gone: removing subscription" ) ;
666
666
false
@@ -671,7 +671,10 @@ impl Subscriptions {
671
671
info ! ( "Token expired: removing subscription" ) ;
672
672
false
673
673
}
674
- Err ( err) => panic ! ( "Error: {:?}" , err) ,
674
+ Err ( err) => {
675
+ info ! ( "Error: {:?} -> removing subscription" , err) ;
676
+ false
677
+ }
675
678
}
676
679
}
677
680
} ) ;
@@ -745,7 +748,7 @@ impl ChangeSubscription {
745
748
if notifications. updates . is_empty ( ) {
746
749
Ok ( ( ) )
747
750
} else {
748
- match & self . sender . send ( notifications) . await {
751
+ match self . sender . send ( notifications) . await {
749
752
Ok ( ( ) ) => Ok ( ( ) ) ,
750
753
Err ( _) => Err ( NotificationError { } ) ,
751
754
}
@@ -785,7 +788,7 @@ impl ChangeSubscription {
785
788
}
786
789
notifications
787
790
} ;
788
- match & self . sender . send ( notifications) . await {
791
+ match self . sender . send ( notifications) . await {
789
792
Ok ( ( ) ) => Ok ( ( ) ) ,
790
793
Err ( _) => Err ( NotificationError { } ) ,
791
794
}
@@ -1421,7 +1424,7 @@ impl<'a, 'b> AuthorizedAccess<'a, 'b> {
1421
1424
match self
1422
1425
. broker
1423
1426
. subscriptions
1424
- . write ( )
1427
+ . read ( )
1425
1428
. await
1426
1429
. notify ( Some ( & changed) , & db)
1427
1430
. await
0 commit comments