From 601c2ed3e557f958cee6cea150a6cf69ee7c91d2 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Tue, 18 Jun 2024 22:54:33 -0700 Subject: [PATCH] clean up shutdown events The shutdown function is called in exactly one place, and that place has a better log message, so we'll just delete the extra one. --- src/main.rs | 2 +- src/service/globals.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 33bbed81..4f1d4b7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -508,7 +508,7 @@ async fn shutdown_signal(handles: Vec) { () = terminate => { sig = "SIGTERM"; }, } - warn!("Received {}, shutting down...", sig); + warn!(signal = %sig, "shutting down due to signal"); services().globals.shutdown(); diff --git a/src/service/globals.rs b/src/service/globals.rs index bed3242b..f83f1f79 100644 --- a/src/service/globals.rs +++ b/src/service/globals.rs @@ -29,7 +29,7 @@ use ruma::{ UserId, }; use tokio::sync::{broadcast, Mutex, RwLock, Semaphore}; -use tracing::{error, info, Instrument}; +use tracing::{error, Instrument}; use trust_dns_resolver::TokioAsyncResolver; use crate::{api::server_server::FedDest, services, Config, Error, Result}; @@ -509,8 +509,6 @@ impl Service { pub(crate) fn shutdown(&self) { self.shutdown.store(true, atomic::Ordering::Relaxed); - // On shutdown - info!(target: "shutdown-sync", "Received shutdown notification, notifying sync helpers..."); services().globals.rotate.fire(); } }