Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Simplify match
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Steiner committed Mar 24, 2020
1 parent e75e41d commit e1fd20d
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions rust/src/common/metric_store/influxdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,17 @@ impl From<CounterMeasurement> for Measurement {
pub async fn run_metricstore(mut influxdb_connector: InfluxDBConnector) {
loop {
match influxdb_connector.receiver.recv().await {
Some(measurement) => match measurement {
Measurement::Round(round) => {
influxdb_connector
.client
.query(&round.into_query("coordinator"))
.await
.map_err(|e| eprintln!("{}", e));
}
Measurement::Counter(counter) => {
influxdb_connector
.client
.query(&counter.into_query("coordinator"))
.await
.map_err(|e| eprintln!("{}", e));
}
},
Some(measurement) => {
let query = match measurement {
Measurement::Round(round) => round.into_query("coordinator"),
Measurement::Counter(counter) => counter.into_query("coordinator"),
};
influxdb_connector
.client
.query(&query)
.await
.map_err(|e| eprintln!("{}", e));
}
None => {
warn!("All senders have been dropped!");
return;
Expand Down

0 comments on commit e1fd20d

Please sign in to comment.