chore: fix error if no id
This commit is contained in:
parent
7f15375e44
commit
6469d0e041
@ -90,6 +90,7 @@ impl AppDataConn {
|
|||||||
pub async fn new(name: String, stores_settings: Vec<StoreSettings>, key: &str) -> Self {
|
pub async fn new(name: String, stores_settings: Vec<StoreSettings>, key: &str) -> Self {
|
||||||
let mut datastores: HashMap<String,DataPool> = HashMap::new();
|
let mut datastores: HashMap<String,DataPool> = HashMap::new();
|
||||||
for settings in stores_settings.iter() {
|
for settings in stores_settings.iter() {
|
||||||
|
if !settings.id.is_empty() { // && datastores_settings.len() == 1usize {
|
||||||
match settings.datastore {
|
match settings.datastore {
|
||||||
DataStore::Redis => {
|
DataStore::Redis => {
|
||||||
datastores.insert(
|
datastores.insert(
|
||||||
@ -118,6 +119,7 @@ impl AppDataConn {
|
|||||||
_ => continue,
|
_ => continue,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Self {
|
Self {
|
||||||
name,
|
name,
|
||||||
datastores,
|
datastores,
|
||||||
@ -174,6 +176,9 @@ impl AppDataConn {
|
|||||||
let debug = envmnt::get_isize("DEBUG",0);
|
let debug = envmnt::get_isize("DEBUG",0);
|
||||||
let mut status = false;
|
let mut status = false;
|
||||||
for con in &datastores_settings {
|
for con in &datastores_settings {
|
||||||
|
if con.id.is_empty() { // && datastores_settings.len() == 1usize {
|
||||||
|
status = true;
|
||||||
|
} else {
|
||||||
match con.datastore {
|
match con.datastore {
|
||||||
DataStore::Redis => {
|
DataStore::Redis => {
|
||||||
status = match self.get_redis(&con.id).await {
|
status = match self.get_redis(&con.id).await {
|
||||||
@ -198,6 +203,7 @@ impl AppDataConn {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user