Skip to content

Commit

Permalink
dns
Browse files Browse the repository at this point in the history
  • Loading branch information
meowjesty committed Dec 31, 2024
1 parent c9a8c81 commit 85f92bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mirrord/agent/src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,16 @@ impl DnsWorker {
let etc_path = self.etc_path.clone();
let timeout = self.timeout;
let attempts = self.attempts;

DNS_REQUEST_COUNT.inc();

let lookup_future = async move {
let result = Self::do_lookup(etc_path, message.request.node, attempts, timeout).await;

if let Err(result) = message.response_tx.send(result) {
tracing::error!(?result, "Failed to send query response");
}
DNS_REQUEST_COUNT.dec();
};

tokio::spawn(lookup_future);
Expand Down Expand Up @@ -188,7 +192,6 @@ impl DnsApi {
}

self.responses.push_back(response_rx);
DNS_REQUEST_COUNT.inc();

Ok(())
}
Expand All @@ -211,8 +214,6 @@ impl DnsApi {
}),
});

DNS_REQUEST_COUNT.dec();

Ok(GetAddrInfoResponse(response))
}
}

0 comments on commit 85f92bd

Please sign in to comment.