From d6513cde74e6c1b94fd43a10f27cf2d500af5a49 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 17 Jun 2023 08:18:51 +0200 Subject: [PATCH] Forgot to handle Option unwrap (#132) * made the query much faster * aggregate queries should be fast now too * forgot to handle an option unwrap --- web3_proxy/src/stats/influxdb_queries.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web3_proxy/src/stats/influxdb_queries.rs b/web3_proxy/src/stats/influxdb_queries.rs index 3634536c..51703b86 100644 --- a/web3_proxy/src/stats/influxdb_queries.rs +++ b/web3_proxy/src/stats/influxdb_queries.rs @@ -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!");