10 lines
323 B
Rust
10 lines
323 B
Rust
use super::super::net::safe_fetch;
|
|
use crate::error::AppError;
|
|
|
|
// Do a request for the given URL, with a minimum time between requests
|
|
// to avoid overloading the server.
|
|
pub async fn do_throttled_request(url: &str) -> Result<String, AppError> {
|
|
let response = safe_fetch(url).await?;
|
|
Ok(response.text().await?)
|
|
}
|