add small comment

This commit is contained in:
Armaël Guéneau 2024-04-26 13:11:25 +02:00
parent 60e8aacfd7
commit b2ba666a11

View file

@ -197,6 +197,10 @@ async fn handle_request(
let tags = [host_tag, method_tag.clone()];
metrics.requests_received.add(1, &tags);
metrics.requests_in_flight.add(1, &tags);
// The guard ensures that we decrement requests_in_flight in all cases where
// the current tasks ends, including the case where it gets canceled and
// doesn't run to completion (which may happen e.g. if it timeouts).
let _guard = InFlightGuard {
metrics: Arc::clone(&metrics),
tags: &tags,