diff --git a/actix-server/Cargo.toml b/actix-server/Cargo.toml index da7d792e..4e0f2aff 100755 --- a/actix-server/Cargo.toml +++ b/actix-server/Cargo.toml @@ -30,7 +30,7 @@ log = "0.4" mio = { version = "0.7.6", features = ["os-poll", "net"] } num_cpus = "1.13" slab = "0.4" -tokio = { version = "1.2", features = ["sync"] } +tokio = { version = "1.4", features = ["sync"] } [dev-dependencies] actix-codec = "0.4.0-beta.1" diff --git a/actix-server/src/server.rs b/actix-server/src/server.rs index 6b9a294f..f37f2867 100644 --- a/actix-server/src/server.rs +++ b/actix-server/src/server.rs @@ -75,7 +75,7 @@ impl Server { // construct signals future. let signals = if !builder.no_signals { // Check tokio runtime. - if tokio::runtime::Handle::try_current().is_err() { + if !is_tokio { let err = io::Error::new(io::ErrorKind::Other, "there is no reactor running. Please enable ServerBuilder::disable_signals when start server in non tokio 1.x runtime."); return Self::Error(Some(err)); } diff --git a/actix-server/src/worker.rs b/actix-server/src/worker.rs index e203462a..ffb0fa6d 100644 --- a/actix-server/src/worker.rs +++ b/actix-server/src/worker.rs @@ -224,6 +224,7 @@ impl ServerWorker { .unwrap_or_else(|| Ok(handle_pair(idx, tx1, tx2, avail))) } + // TODO: Use start_non_blocking when restarting worker. #[allow(dead_code)] /// Start server worker in async. pub(crate) fn start_non_blocking(