Skip to content

Commit

Permalink
feat(server): debug public key when dht_server has a cache hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuhvi committed May 11, 2024
1 parent 75b2e08 commit 700d089
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/src/dht_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ impl Server for DhtServer {
} = request
{
let should_query = if let Some(cached) = self.cache.get(target) {
debug!(
public_key = ?cached.public_key(),
?target,
"cache hit responding with packet!"
);

// Respond with what we have, even if expired.
let mutable_item = MutableItem::from(&cached);
debug!(?target, "cache hit responding with packet!");

rpc.response(
from,
Expand All @@ -97,6 +102,7 @@ impl Server for DhtServer {

if expired {
debug!(
public_key = ?cached.public_key(),
?target,
?expires_in,
"cache expired, querying the DHT to hydrate our cache for later."
Expand Down

0 comments on commit 700d089

Please sign in to comment.