enh modulesmanager
This commit is contained in:
parent
ad137f5530
commit
08f0043f48
1 changed files with 11 additions and 2 deletions
|
@ -67,7 +67,7 @@ struct Routine {}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ModulesManager {
|
pub struct ModulesManager {
|
||||||
modulesdb: HashMap<ModType,Vec<ModStatusType>>,
|
statusdb: HashMap<ModType,Vec<ModStatusType>>,
|
||||||
botactions: HashMap<ModType,Vec<BotAction>>,
|
botactions: HashMap<ModType,Vec<BotAction>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ impl ModulesManager {
|
||||||
|
|
||||||
|
|
||||||
let mgr = ModulesManager {
|
let mgr = ModulesManager {
|
||||||
modulesdb : m,
|
statusdb : m,
|
||||||
botactions : act,
|
botactions : act,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -142,6 +142,15 @@ impl ModulesManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fn statuscleanup(&self,chnl:Option<ChType>) -> () {
|
||||||
|
// internal cleans up statusdb . For example :
|
||||||
|
// - remove redudancies . If we see several Enabled("m"), only keep 1x
|
||||||
|
// - Clarify Conflict. If we see Enabled("m") and Disabled("m") , we remove Enabled("m") and keep Disabled("m")
|
||||||
|
// the IDEAL is that this is ran before every read/update operation to ensure quality
|
||||||
|
// Option<ChType> can pass Some(Channel("m")) (as an example) so statuscleanup only works on the given channel
|
||||||
|
// Passing None to chnl may be a heavy operation, as this will review and look at the whole table
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue