From f1f990795e6aad0160d9ee8736d0357248b66caf Mon Sep 17 00:00:00 2001 From: Njuguna Mureithi Date: Tue, 28 Mar 2023 09:23:41 +0300 Subject: [PATCH] Fix runtime error --- packages/apalis-core/Cargo.toml | 2 +- packages/apalis-core/src/monitor.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/apalis-core/Cargo.toml b/packages/apalis-core/Cargo.toml index 996b2d0e..fb947023 100644 --- a/packages/apalis-core/Cargo.toml +++ b/packages/apalis-core/Cargo.toml @@ -27,7 +27,7 @@ sentry-core = { version= "0.25.0", optional = true, default-features = false } metrics = { version = "0.20", optional = true, default-features = false } metrics-exporter-prometheus = { version = "0.11", optional = true, default-features = false } async-trait = { version = "0.1" } -graceful-shutdown = { version = "0.2", features = ["stream", "async-io-timeout" ] } +graceful-shutdown = { version = "0.2", features = ["stream", "tokio-timeout" ] } uuid = { version = "0.8", features = ["serde", "v4"] } async-stream = "0.3" diff --git a/packages/apalis-core/src/monitor.rs b/packages/apalis-core/src/monitor.rs index 048a732f..7a9a2dce 100644 --- a/packages/apalis-core/src/monitor.rs +++ b/packages/apalis-core/src/monitor.rs @@ -167,7 +167,7 @@ impl Monitor { // .map(|h| (h.0, h.1.is_finished())) // .collect(); if let Some(timeout) = self.timeout { - if self.shutdown.with_timer(timeout).await { + if self.shutdown.with_timeout(timeout).await { warn!("Shutdown timeout reached. Exiting forcefully"); return Err(std::io::Error::new( std::io::ErrorKind::TimedOut,