diff --git a/noxis-rs/src/utils/files.rs b/noxis-rs/src/utils/files.rs index 22060fb..8ba72f7 100644 --- a/noxis-rs/src/utils/files.rs +++ b/noxis-rs/src/utils/files.rs @@ -19,8 +19,6 @@ pub mod v2 { // type EventHandlers<'a> = HashMap type EventHandlers<'a> = HashMap<&'a str, (Triggers<'a>, MpscSender>)>; - // - type FileTriggersWrapper<'a> = HashMap<&'a str, Triggers<'a>>; struct FilesController<'a> { name: &'a str, @@ -54,12 +52,12 @@ pub mod v2 { } async fn trigger_on(&mut self, trigger_type: Option) { let _ = self.triggers.iter() - .map(|(_, (triggers, channel))| async { + .map(|(prc_name, (triggers, channel))| async { let _ = channel.send({ match &trigger_type { None => Events::Positive(self.name), Some(event) => { - info!("Event on {} ({}) : {}", self.name, &self.path, event); + info!("Event on file {} ({}) : {}. Notifying `{}` ...", self.name, &self.path, event, *prc_name); event.event_from_file_trigger_controller(self.name, triggers) }, } @@ -94,7 +92,8 @@ pub mod v2 { }, } } - self.trigger_on(Some(FileTriggerType::OnChange)).await; + self.trigger_on(Some(FileTriggerType::OnChange)).await; + return; } } },