Forgot to handle Option unwrap (#132)

* made the query much faster

* aggregate queries should be fast now too

* forgot to handle an option unwrap
This commit is contained in:
David 2023-06-17 08:18:51 +02:00 committed by GitHub
parent 86f9e7358a
commit d6513cde74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -423,12 +423,14 @@ pub async fn query_user_stats<'a>(
} else if key == "rpc_secret_key_id" {
match value {
influxdb2_structmap::value::Value::String(inner) => {
out.insert(
"rpc_key",
serde_json::Value::String(
rpc_key_id_to_key.get(&inner).unwrap().to_string(),
),
);
match rpc_key_id_to_key.get(&inner) {
Some(x) => {
out.insert("rpc_key", serde_json::Value::String(x.to_string()));
}
None => {
debug!("rpc_secret_key_id is not included in this query")
}
}
}
_ => {
error!("rpc_secret_key_id should always be a String!");