mirror of https://github.com/buster-so/buster.git
Update apps/api/libs/handlers/src/metrics/get_metric_data_handler.rs
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
parent
75cdd858ab
commit
f5b911cd12
|
@ -204,9 +204,10 @@ pub async fn get_metric_data_handler(
|
|||
let has_more_records = query_result.data.len() > 5000;
|
||||
|
||||
// Truncate to 5000 records if we got more
|
||||
let data = if has_more_records {
|
||||
query_result.data.into_iter().take(5000).collect()
|
||||
} else {
|
||||
let mut data = query_result.data;
|
||||
if has_more_records {
|
||||
data.truncate(5000);
|
||||
}
|
||||
query_result.data
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue