File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ impl Adapter {
206
206
207
207
pub async fn run ( & mut self ) {
208
208
loop {
209
+ self . drop_closed_subscriptions ( ) ;
209
210
tokio:: select! {
210
211
Some ( message) = self . message_rx. recv( ) => {
211
212
if let Err ( err) = self . handle_message( message) . await {
@@ -510,6 +511,16 @@ impl Adapter {
510
511
Ok ( ( ) )
511
512
}
512
513
514
+ fn drop_closed_subscriptions ( & mut self ) {
515
+ for subscriptions in self . notify_price_subscriptions . values_mut ( ) {
516
+ subscriptions. retain ( |subscription| !subscription. notify_price_tx . is_closed ( ) )
517
+ }
518
+
519
+ for subscriptions in self . notify_price_sched_subscriptions . values_mut ( ) {
520
+ subscriptions. retain ( |subscription| !subscription. notify_price_sched_tx . is_closed ( ) )
521
+ }
522
+ }
523
+
513
524
async fn handle_update_price (
514
525
& self ,
515
526
account : & solana_sdk:: pubkey:: Pubkey ,
You can’t perform that action at this time.
0 commit comments