Преглед на файлове

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

ghassmo преди 4 години
родител
ревизия
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?;
 
-        irc_server.start(executor).await?;
+        let executor_cloned = executor.clone();
+        executor
+            .spawn(async move {
+                irc_server.start(executor_cloned.clone()).await.unwrap();
+            })
+            .detach();
         Ok(())
     }
 }