Skip to content

Commit

Permalink
fix: dont fail if scam guard times out
Browse files Browse the repository at this point in the history
  • Loading branch information
xDarksome committed Feb 7, 2024
1 parent d0115a2 commit 5c1c8c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ impl<'a, I: Infra> Handle<GetAttestation<'a>> for Service<I> {
.is_scam(&origin)
.with_timeout(Duration::from_secs(10))
.await
.context("ScamGuard::is_scam timed out")?
.map_err(|e| error!("ScamGuard::is_scam: {e:?}"))
.map_err(|_| error!("ScamGuard::is_scam timed out"))
.ok()
.and_then(|res| res.map_err(|e| error!("ScamGuard::is_scam: {e:?}")).ok())
.unwrap_or(IsScam::Unknown);

Ok(Some(Attestation { origin, is_scam }))
Expand Down

0 comments on commit 5c1c8c1

Please sign in to comment.