Преглед изворни кода

bin/ircd: detach the main loop for ctrlc to work properly

ghassmo пре 3 година
родитељ
комит
77c8dbabcd
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      bin/ircd/src/main.rs

+ 6 - 1
bin/ircd/src/main.rs

@@ -86,7 +86,12 @@ impl Ircd {
         )
         )
         .await?;
         .await?;
 
 
-        irc_server.start(executor).await?;
+        let executor_cloned = executor.clone();
+        executor
+            .spawn(async move {
+                irc_server.start(executor_cloned.clone()).await.unwrap();
+            })
+            .detach();
         Ok(())
         Ok(())
     }
     }
 }
 }