mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
better new event logging
This commit is contained in:
parent
0d503a5857
commit
28c2439989
@ -18,7 +18,12 @@ impl Minion {
|
|||||||
if let Err(e) = event.verify(Some(maxtime)) {
|
if let Err(e) = event.verify(Some(maxtime)) {
|
||||||
error!("VERIFY ERROR: {}, {}", e, serde_json::to_string(&event)?)
|
error!("VERIFY ERROR: {}, {}", e, serde_json::to_string(&event)?)
|
||||||
} else {
|
} 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?;
|
crate::process::process_new_event(&event, true, Some(self.url.clone())).await?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,15 @@ impl Subscriptions {
|
|||||||
self.by_id.get(id).cloned()
|
self.by_id.get(id).cloned()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_handle_by_id(&self, id: &str) -> Option<String> {
|
||||||
|
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> {
|
pub fn get_mut(&mut self, handle: &str) -> Option<&mut Subscription> {
|
||||||
match self.handle_to_id.get(handle) {
|
match self.handle_to_id.get(handle) {
|
||||||
None => None,
|
None => None,
|
||||||
|
Loading…
Reference in New Issue
Block a user