Skip to content

Commit

Permalink
feat(middleware): amend batch method name.
Browse files Browse the repository at this point in the history
  • Loading branch information
andysim3d committed Sep 26, 2024
1 parent a28eb59 commit 10fa089
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/provider/src/traits/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl RequestExtractor<RequestPacket> for RPCMethodExtractor {
}
_ => {
// can't extract method name for batch.
"unknown".to_string()
"batch".to_string()
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/rpc/src/rpc_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
use jsonrpsee::types::Request;
use rundler_types::task::traits::RequestExtractor;

#[derive(Copy)]
#[derive(Copy, Clone)]
struct RPCMethodExtractor;

impl RequestExtractor<Request> for RPCMethodExtractor {
fn get_method_name(req: &Request) -> String {
impl RequestExtractor<Request<'static>> for RPCMethodExtractor {
fn get_method_name(req: & Request<'static>) -> String {
req.method_name().to_string()
}
}

0 comments on commit 10fa089

Please sign in to comment.