Просмотр исходного кода

p2p: reorder shutdown sequence to reduce lag on CTRL-C

draoi 2 лет назад
Родитель
Сommit
498a88e3b9
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/net/p2p.rs

+ 1 - 1
src/net/p2p.rs

@@ -160,10 +160,10 @@ impl P2p {
     /// Stop the running P2P subsystem
     /// Stop the running P2P subsystem
     pub async fn stop(&self) {
     pub async fn stop(&self) {
         // Stop the sessions
         // Stop the sessions
+        self.session_refine().stop().await;
         self.session_manual().stop().await;
         self.session_manual().stop().await;
         self.session_inbound().stop().await;
         self.session_inbound().stop().await;
         self.session_outbound().stop().await;
         self.session_outbound().stop().await;
-        self.session_refine().stop().await;
     }
     }
 
 
     /// Broadcasts a message concurrently across all active channels.
     /// Broadcasts a message concurrently across all active channels.