Explorar o código

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

ghassmo %!s(int64=4) %!d(string=hai) anos
pai
achega
77c8dbabcd
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      bin/ircd/src/main.rs

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

@@ -86,7 +86,12 @@ impl Ircd {
         )
         .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(())
     }
 }