mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-11 01:31:38 +00:00
add retry to download_input (#676)
This commit is contained in:
parent
7ebdeac537
commit
f0e5823c0a
@ -4,7 +4,8 @@
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
use onefuzz::{http::ResponseExt, jitter::delay_with_jitter};
|
||||
use reqwest::Url;
|
||||
use reqwest::{Client, Url};
|
||||
use reqwest_retry::SendRetry;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::time::Duration;
|
||||
use tokio::{fs, io};
|
||||
@ -13,7 +14,9 @@ pub async fn download_input(input_url: Url, dst: impl AsRef<Path>) -> Result<Pat
|
||||
let file_name = input_url.path_segments().unwrap().last().unwrap();
|
||||
let file_path = dst.as_ref().join(file_name);
|
||||
|
||||
let resp = reqwest::get(input_url)
|
||||
let resp = Client::new()
|
||||
.get(input_url)
|
||||
.send_retry_default()
|
||||
.await?
|
||||
.error_for_status_with_body()
|
||||
.await?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user