move unix socket unlink from services to router

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-05-31 00:43:30 +00:00 committed by June 🍓🦴
parent 2e45cb281a
commit 6d1144bb69
3 changed files with 24 additions and 21 deletions

View file

@ -6,11 +6,8 @@ use std::{
use conduit::{debug_info, Result, Server};
use database::KeyValueDatabase;
use lru_cache::LruCache;
use tokio::{
fs,
sync::{broadcast, Mutex, RwLock},
};
use tracing::{debug, info, trace, warn};
use tokio::sync::{broadcast, Mutex, RwLock};
use tracing::{debug, info, trace};
use crate::{
account_data, admin, appservice, globals, key_backups, media, presence, pusher, rooms, sending, transaction_ids,
@ -321,13 +318,6 @@ bad_signature_ratelimiter: {bad_signature_ratelimiter}
info!("Shutting down services");
self.interrupt().await;
debug!("Removing unix socket file.");
if let Some(path) = self.globals.unix_socket_path().as_ref() {
if let Err(e) = fs::remove_file(path).await {
warn!("Failed to remove UNIX socket file: {e}");
}
}
debug!("Waiting for update worker...");
if let Some(updates_handle) = self.globals.updates_handle.lock().await.take() {
updates_handle.abort();