Skip to content

Commit

Permalink
move metric creation to conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmindlin committed Mar 20, 2024
1 parent 2c1333d commit db78b9f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ where
response_time,
domain,
} => {
let metric = ProxyMetric {
proxy_id,
domain: domain.unwrap_or("".to_string()),
status: status.as_u16(),
response_time,
};

if let Some(client) = &mut self.metrics_clients {
let metric = ProxyMetric {
proxy_id,
domain: domain.unwrap_or("".to_string()),
status: status.as_u16(),
response_time,
};

if let Err(e) = client.send_proxy_metric(&metric) {
warn!("error sending proxy metric: {e:?}");
};
}
}

// Modify success coefficient in DB
Expand Down

0 comments on commit db78b9f

Please sign in to comment.