Fix: Lookup reload does not include database settings

This commit is contained in:
mdecimus 2024-09-08 17:01:38 +02:00
parent efbddd1cdd
commit 794b8f2e50
3 changed files with 13 additions and 2 deletions

View file

@ -64,7 +64,7 @@ impl Core {
}
pub async fn reload_lookups(&self) -> trc::Result<ReloadResult> {
let mut config = self.storage.config.build_config("certificate").await?;
let mut config = self.storage.config.build_config("lookup").await?;
let mut stores = Stores::default();
stores.parse_memory_stores(&mut config);

View file

@ -19,6 +19,7 @@ use utils::config::{utils::AsKey, Config};
pub mod lookup;
pub mod pool;
#[derive(Debug)]
pub struct RedisStore {
pool: RedisPool,
}
@ -186,3 +187,12 @@ fn build_pool<M: Manager>(
fn into_error(err: impl Display) -> trc::Error {
trc::StoreEvent::RedisError.reason(err)
}
impl std::fmt::Debug for RedisPool {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Single(_) => f.debug_tuple("Single").finish(),
Self::Cluster(_) => f.debug_tuple("Cluster").finish(),
}
}
}

View file

@ -219,7 +219,7 @@ pub enum FtsStore {
ElasticSearch(Arc<ElasticSearchStore>),
}
#[derive(Clone)]
#[derive(Clone, Debug)]
pub enum LookupStore {
Store(Store),
Query(Arc<QueryStore>),
@ -228,6 +228,7 @@ pub enum LookupStore {
Memory(Arc<MemoryStore>),
}
#[derive(Debug)]
pub struct QueryStore {
pub store: LookupStore,
pub query: String,