1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 12:10:37 +02:00

server: panic earlier if neither runtime detected

This commit is contained in:
Rob Ede
2021-11-21 22:42:23 +00:00
parent 7e7df2f931
commit 161f239f12
2 changed files with 29 additions and 5 deletions

View File

@ -136,11 +136,9 @@ impl Server {
let is_tokio = tokio::runtime::Handle::try_current().is_ok();
match (is_actix, is_tokio) {
(false, true) => info!("Tokio runtime found. Starting in existing Tokio runtime"),
(true, _) => info!("Actix runtime found. Starting in Actix runtime"),
(_, _) => info!(
"Actix/Tokio runtime not found. Starting in newt Tokio current-thread runtime"
),
(true, _) => info!("Actix runtime found; starting in Actix runtime"),
(_, true) => info!("Tokio runtime found; starting in existing Tokio runtime"),
(_, false) => panic!("Actix or Tokio runtime not found; halting"),
}
for (_, name, lst) in &builder.sockets {