Add comments to metrics

To improve readability.
This commit is contained in:
finga 2021-11-18 00:16:09 +01:00
parent 181edf589c
commit 83785cc77d

View file

@ -434,9 +434,13 @@ async fn metrics(
metrics: &State<WebhookeyMetrics>,
config: &State<Config>,
) -> Option<String> {
// Are metrics configured?
if let Some(metrics_config) = &config.metrics {
// Are metrics enabled?
if metrics_config.enabled {
// Is a filter configured?
if let Some(filter) = &metrics_config.ip_filter {
// Does the request match the filter?
if filter.validate(&address.ip()) {
return Some(get_metrics(metrics));
}