Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: combined datapoints and requests with zip instead of enumerating
Browse files Browse the repository at this point in the history
Lilit0x committed Oct 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent ba8032c commit 7337bcf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/servers/src/http/opentsdb.rs
Original file line number Diff line number Diff line change
@@ -110,14 +110,11 @@ pub async fn put(
},
};

for (idx, data_point) in data_points.into_iter().enumerate() {
for (data_point, request) in data_points.into_iter().zip(data_point_requests) {
let result = opentsdb_handler.exec(vec![data_point], ctx.clone()).await;
match result {
Ok(affected_rows) => response.on_success(affected_rows),
Err(e) => {
let data_point_request = data_point_requests.get(idx).unwrap();
response.on_failed(data_point_request.clone(), e);
}
Err(e) => response.on_failed(request, e),
}
}
(

0 comments on commit 7337bcf

Please sign in to comment.