Skip to content

Commit

Permalink
adding 403 error to retry errors for fetch_github_list
Browse files Browse the repository at this point in the history
  • Loading branch information
robinsteuteville committed Jan 23, 2024
1 parent 4c4f1d9 commit 512284a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/fastsim-core/src/vehicle_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1809,7 +1809,7 @@ const VEHICLE_REPO_LIST_URL: &'static str =
fn get_response<S: AsRef<str>>(url: S) -> Result<Response, OtherError> {
for _ in 1..4 {
match ureq::get(url.as_ref()).call() {
Err(Status(503, r)) | Err(Status(429, r)) => {
Err(Status(503, r)) | Err(Status(429, r)) | Err(Status(403, r)) => {
let retry: Option<u64> = r.header("retry-after").and_then(|h| h.parse().ok());
let retry = retry.unwrap_or(5);
eprintln!("{} for {}, retry in {}", r.status(), r.get_url(), retry);
Expand Down

0 comments on commit 512284a

Please sign in to comment.