feat: tell user that we are shutting down (#1360)

This commit is contained in:
Bjerg
2023-02-15 04:59:28 +01:00
committed by GitHub
parent ddab623a46
commit 32a1966ebf

View File

@ -3,7 +3,7 @@
use futures::pin_mut;
use reth_tasks::{TaskExecutor, TaskManager};
use std::{future::Future, time::Duration};
use tracing::trace;
use tracing::{trace, warn};
/// Used to execute cli commands
#[derive(Default, Debug)]
@ -39,6 +39,7 @@ impl CliRunner {
// give all tasks that are now being shut down some time to finish before tokio leaks them
// see [Runtime::shutdown_timeout](tokio::runtime::Runtime::shutdown_timeout)
warn!(target: "reth::cli", "Received shutdown signal, waiting up to 30 seconds for tasks.");
tokio_runtime.shutdown_timeout(Duration::from_secs(30));
Ok(())