Skip to content

Commit

Permalink
feat: identity caching + metrics (#197)
Browse files Browse the repository at this point in the history
* refactor: minimize function params

* fix: ci

* feat: identity cache Redis config

* fix: clippy

* feat: initial ENS lookup

* chore: remove wrong comment

* chore: remove unwraps

* feat: error handling for no ENS name or no avatar

* chore: pass error better

* fix: follow Rust API guidelines

* feat: metrics

* fix: hashicorp/terraform-provider-aws#28353

* feat: local Terraform development

* feat: metrics + caching

* feat: cache for a day

* chore: more logging

* chore: tweaks

* fix(ci): terraform fmt

* fix(ci): terraform fmt

* feat: replace cache-hit metric with source

* fix: ECS doesn't update if tag doesn't change

* chore: DRY result metrics collection

* fix: cache 404 responses, metrics

* chore: outdated comment

* chore: tweak error
  • Loading branch information
chris13524 authored Jun 26, 2023
1 parent 02799fd commit 0f030f9
Show file tree
Hide file tree
Showing 27 changed files with 721 additions and 109 deletions.
44 changes: 17 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ axum-tungstenite = "0.2.0"

rand = "0.8.4"
prometheus-http-query = "0.6.6"
ethers = "2.0.7"
ethers = { version = "2.0.7", git = "https://github.com/gakonst/ethers-rs" } # using Git version because crates.io version fails clippy


[dev-dependencies]
Expand Down
11 changes: 0 additions & 11 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ pub enum RpcError {
#[error("Invalid address")]
IdentityInvalidAddress,

#[error("Identity not found. Error: {0}")]
IdentityNotFound(String),

#[error("Ethers provider error: {0}")]
EthersProviderError(ethers::providers::ProviderError),
}
Expand Down Expand Up @@ -127,14 +124,6 @@ impl IntoResponse for RpcError {
)),
)
.into_response(),
Self::IdentityNotFound(e) => (
StatusCode::NOT_FOUND,
Json(new_error_response(
"address".to_string(),
format!("Could not find the ENS name: {e}"),
)),
)
.into_response(),
e => {
error!("Internal server error: {}", e);
(
Expand Down
Loading

0 comments on commit 0f030f9

Please sign in to comment.