From e1137fadd8157b8c313228bc53ddc82a23c757fc Mon Sep 17 00:00:00 2001 From: asonix Date: Tue, 15 Nov 2022 22:10:15 -0600 Subject: [PATCH] Handle other request in nodeinfo job --- src/jobs/nodeinfo.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/jobs/nodeinfo.rs b/src/jobs/nodeinfo.rs index 77f10c8..dbe2717 100644 --- a/src/jobs/nodeinfo.rs +++ b/src/jobs/nodeinfo.rs @@ -41,10 +41,18 @@ impl QueryNodeinfo { let scheme = self.actor_id.scheme_str(); let well_known_uri = iri!(format!("{}://{}/.well-known/nodeinfo", scheme, authority)); - let well_known = state + let well_known = match state .requests .fetch_json::(well_known_uri.as_str()) - .await?; + .await + { + Ok(well_known) => well_known, + Err(e) if e.is_breaker() => { + tracing::debug!("Not retrying due to failed breaker"); + return Ok(()); + } + Err(e) => return Err(e), + }; let href = if let Some(link) = well_known.links.into_iter().find(|l| l.rel.is_supported()) { link.href