Skip to content

Commit

Permalink
fix(pkarr): don't make resolve query despite cache hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuhvi committed Jun 29, 2024
1 parent a7f4fc7 commit b616854
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkarr/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,11 @@ impl PkarrClient {
sender
.send(cached.clone())
.map_err(|_| Error::DhtIsShutdown)?;
} else {
debug!(expires_in, "Have expired signed_packet in cache.");

return Ok(receiver);
}

debug!(expires_in, "Have expired signed_packet in cache.");
} else {
debug!("Cache mess");
}
Expand Down
2 changes: 2 additions & 0 deletions pkarr/src/relay_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ impl PkarrRelayClient {
if expires_in > 0 {
debug!(expires_in, "Have fresh signed_packet in cache.");
let _ = sender.send(Ok(Some(cached.clone())));

return receiver;
}

debug!(expires_in, "Have expired signed_packet in cache.");
Expand Down

0 comments on commit b616854

Please sign in to comment.