move unix socket unlink from services to router
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
2e45cb281a
commit
6d1144bb69
3 changed files with 24 additions and 21 deletions
|
@ -395,8 +395,6 @@ impl Service {
|
|||
|
||||
pub fn well_known_server(&self) -> &Option<OwnedServerName> { &self.config.well_known.server }
|
||||
|
||||
pub fn unix_socket_path(&self) -> &Option<PathBuf> { &self.config.unix_socket_path }
|
||||
|
||||
pub fn valid_cidr_range(&self, ip: &IPAddress) -> bool {
|
||||
for cidr in &self.cidr_range_denylist {
|
||||
if cidr.includes(ip) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue