mirror of
https://git.asonix.dog/asonix/relay.git
synced 2024-11-25 19:11:08 +00:00
Debug log all node cache misses
This commit is contained in:
parent
9f98015d7f
commit
76b43e705a
1 changed files with 13 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
||||||
use crate::{db::Db, error::MyError};
|
use crate::{db::Db, error::MyError};
|
||||||
use activitystreams::primitives::XsdAnyUri;
|
use activitystreams::primitives::XsdAnyUri;
|
||||||
use bb8_postgres::tokio_postgres::types::Json;
|
use bb8_postgres::tokio_postgres::types::Json;
|
||||||
use log::{error, info};
|
use log::{debug, error};
|
||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, HashSet},
|
collections::{HashMap, HashSet},
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
|
@ -49,13 +49,19 @@ impl NodeCache {
|
||||||
let read_guard = self.nodes.read().await;
|
let read_guard = self.nodes.read().await;
|
||||||
|
|
||||||
let node = match read_guard.get(listener) {
|
let node = match read_guard.get(listener) {
|
||||||
None => return true,
|
None => {
|
||||||
|
debug!("No node for listener {}", listener);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Some(node) => node,
|
Some(node) => node,
|
||||||
};
|
};
|
||||||
|
|
||||||
match node.info.as_ref() {
|
match node.info.as_ref() {
|
||||||
Some(nodeinfo) => nodeinfo.outdated(),
|
Some(nodeinfo) => nodeinfo.outdated(),
|
||||||
None => true,
|
None => {
|
||||||
|
debug!("No info for node {}", node.base);
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +70,7 @@ impl NodeCache {
|
||||||
|
|
||||||
let node = match read_guard.get(listener) {
|
let node = match read_guard.get(listener) {
|
||||||
None => {
|
None => {
|
||||||
info!("No node for listener {}", listener);
|
debug!("No node for listener {}", listener);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Some(node) => node,
|
Some(node) => node,
|
||||||
|
@ -73,7 +79,7 @@ impl NodeCache {
|
||||||
match node.contact.as_ref() {
|
match node.contact.as_ref() {
|
||||||
Some(contact) => contact.outdated(),
|
Some(contact) => contact.outdated(),
|
||||||
None => {
|
None => {
|
||||||
info!("No contact for node {}", node.base);
|
debug!("No contact for node {}", node.base);
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,7 +90,7 @@ impl NodeCache {
|
||||||
|
|
||||||
let node = match read_guard.get(listener) {
|
let node = match read_guard.get(listener) {
|
||||||
None => {
|
None => {
|
||||||
info!("No node for listener {}", listener);
|
debug!("No node for listener {}", listener);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Some(node) => node,
|
Some(node) => node,
|
||||||
|
@ -93,7 +99,7 @@ impl NodeCache {
|
||||||
match node.instance.as_ref() {
|
match node.instance.as_ref() {
|
||||||
Some(instance) => instance.outdated(),
|
Some(instance) => instance.outdated(),
|
||||||
None => {
|
None => {
|
||||||
info!("No instance for node {}", node.base);
|
debug!("No instance for node {}", node.base);
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue