diff --git a/src/overlord/minion/handle_websocket.rs b/src/overlord/minion/handle_websocket.rs index c1229362..e0e848da 100644 --- a/src/overlord/minion/handle_websocket.rs +++ b/src/overlord/minion/handle_websocket.rs @@ -18,7 +18,12 @@ impl Minion { if let Err(e) = event.verify(Some(maxtime)) { error!("VERIFY ERROR: {}, {}", e, serde_json::to_string(&event)?) } else { - debug!("NEW EVENT ON {}", subid.0); + let handle = self + .subscriptions + .get_handle_by_id(&subid.0) + .unwrap_or_else(|| "_".to_owned()); + debug!("NEW EVENT on {} [{}]", &self.url, handle); + crate::process::process_new_event(&event, true, Some(self.url.clone())).await?; } } diff --git a/src/overlord/minion/subscription.rs b/src/overlord/minion/subscription.rs index ad70b520..bfc9f7ff 100644 --- a/src/overlord/minion/subscription.rs +++ b/src/overlord/minion/subscription.rs @@ -40,6 +40,15 @@ impl Subscriptions { self.by_id.get(id).cloned() } + pub fn get_handle_by_id(&self, id: &str) -> Option { + for (handle, xid) in self.handle_to_id.iter() { + if id == xid { + return Some(handle.to_string()); + } + } + None + } + pub fn get_mut(&mut self, handle: &str) -> Option<&mut Subscription> { match self.handle_to_id.get(handle) { None => None,