reorg statusdb

This commit is contained in:
ModulatingForce 2024-03-21 00:11:24 -04:00
parent a066329730
commit 1b44ec4f4c

View file

@ -180,7 +180,8 @@ pub struct Routine {}
pub struct ModulesManager {
// statusdb: Arc<RwLock<HashMap<ModType, Vec<ModStatusType>>>>,
statusdb: Arc<RwLock<HashMap<(ModType,ModGroup), Vec<StatusType>>>>,
// statusdb: Arc<RwLock<HashMap<(ModType,ModGroup), Vec<StatusType>>>>,
statusdb: Arc<RwLock<HashMap<ModType, (ModGroup, Vec<StatusType>)>>>,
pub botactions: Arc<RwLock<HashMap<ModType, Vec<BotAction>>>>,
}
@ -374,11 +375,11 @@ impl ModulesManager {
let mut dbt = self.statusdb.write().await;
//
let statusvector = dbt.entry((in_module.clone(),in_modgroup.clone())).or_insert(Vec::new());
let statusvector = dbt.entry(in_module.clone()).or_insert((in_modgroup.clone(),Vec::new()));
match in_modgroup {
ModGroup::Core => statusvector.push(StatusType::Enabled(StatusLvl::Instance)) , // Pushes the Module as Enabled at Instance Level
ModGroup::Custom => statusvector.push(StatusType::Disabled(StatusLvl::Instance)),
ModGroup::Core => statusvector.1.push(StatusType::Enabled(StatusLvl::Instance)) , // Pushes the Module as Enabled at Instance Level
ModGroup::Custom => statusvector.1.push(StatusType::Disabled(StatusLvl::Instance)),
}
// statusvector.push(ModStatusType::Enabled(StatusLvl::Instance)); // Pushes the Module as Enabled at Instance Level