Revert back to reqwest, using rustls feature (#6041)
* Revert back to reqwest, using rustls feature * Cargo.lock and crate-features * Ignore test
This commit is contained in:
@@ -12,9 +12,9 @@ edition = "2018"
|
||||
env_logger = "0.6.2"
|
||||
lazy_static = "1.4.0"
|
||||
log = "0.4.8"
|
||||
reqwest = { version = "0.9.20", default-features = false, features = ["rustls-tls"] }
|
||||
solana-sdk = { path = "../sdk", version = "0.20.0" }
|
||||
sys-info = "0.5.8"
|
||||
ureq = "0.11.1"
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.6.5"
|
||||
|
@@ -97,16 +97,20 @@ impl MetricsWriter for InfluxDbMetricsWriter {
|
||||
line.push_str(&format!(" {}\n", &point.timestamp));
|
||||
}
|
||||
|
||||
let response = ureq::post(write_url.as_str())
|
||||
.timeout_connect(2_000)
|
||||
.timeout_read(2_000)
|
||||
.timeout_write(4_000)
|
||||
.send_string(&line);
|
||||
info!(
|
||||
"submit response: {} {}",
|
||||
response.status(),
|
||||
response.status_text()
|
||||
);
|
||||
let client = reqwest::Client::builder()
|
||||
.timeout(Duration::from_secs(5))
|
||||
.build()
|
||||
.unwrap();
|
||||
let response = client.post(write_url.as_str()).body(line).send();
|
||||
if let Ok(mut resp) = response {
|
||||
info!(
|
||||
"submit response: {} {}",
|
||||
resp.status(),
|
||||
resp.text().unwrap()
|
||||
);
|
||||
} else {
|
||||
error!("submit error: {}", response.unwrap_err());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -399,9 +403,9 @@ pub fn query(q: &str) -> Result<String, String> {
|
||||
&config.host, &config.username, &config.password, &q
|
||||
);
|
||||
|
||||
let response = ureq::get(query_url.as_str())
|
||||
.call()
|
||||
.into_string()
|
||||
let response = reqwest::get(query_url.as_str())
|
||||
.map_err(|err| err.to_string())?
|
||||
.text()
|
||||
.map_err(|err| err.to_string())?;
|
||||
|
||||
Ok(response)
|
||||
|
Reference in New Issue
Block a user