Skip to content

Commit ec9c02a

Browse files
committed
retry crates.io requests when requesting crate-owners
1 parent ce5e694 commit ec9c02a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index/api.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ impl Api {
157157
login: Option<String>,
158158
}
159159

160-
let response: Response = self.client.get(url).send()?.error_for_status()?.json()?;
160+
let response: Response = retry(
161+
|| Ok(self.client.get(url.clone()).send()?.error_for_status()?),
162+
3,
163+
)?
164+
.json()?;
161165

162166
let result = response
163167
.users

0 commit comments

Comments
 (0)