From 08f0043f485934b56f9774810b19f3d9a1217acf Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Thu, 21 Dec 2023 12:10:50 -0500 Subject: [PATCH] enh modulesmanager --- src/core/botmodules.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/core/botmodules.rs b/src/core/botmodules.rs index bff25ea..633e099 100644 --- a/src/core/botmodules.rs +++ b/src/core/botmodules.rs @@ -67,7 +67,7 @@ struct Routine {} #[derive(Debug)] pub struct ModulesManager { - modulesdb: HashMap>, + statusdb: HashMap>, botactions: HashMap>, } @@ -108,7 +108,7 @@ impl ModulesManager { let mgr = ModulesManager { - modulesdb : m, + statusdb : m, botactions : act, }; @@ -142,6 +142,15 @@ impl ModulesManager { } + fn statuscleanup(&self,chnl:Option) -> () { + // 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 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 + () + }