-use crate::{settings::structs::Settings, version::VERSION, LemmyError};
+use crate::{settings::structs::Settings, version::VERSION, LemmyError, REQWEST_TIMEOUT};
use anyhow::anyhow;
use encoding::{all::encodings, DecoderTrap};
use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};
use reqwest_middleware::ClientWithMiddleware;
use serde::{Deserialize, Serialize};
-use std::{future::Future, time::Duration};
+use std::future::Future;
use thiserror::Error;
use tracing::{error, info};
use url::Url;
info!("Fetching site metadata for url: {}", url);
let response = client
.get(url.as_str())
- .timeout(Duration::from_secs(30))
+ .timeout(REQWEST_TIMEOUT)
.send()
.await?;
let response = client
.get(&fetch_url)
- .timeout(Duration::from_secs(30))
+ .timeout(REQWEST_TIMEOUT)
.send()
.await?;
async fn is_image_content_type(client: &ClientWithMiddleware, url: &Url) -> Result<(), LemmyError> {
let response = client
.get(url.as_str())
- .timeout(Duration::from_secs(30))
+ .timeout(REQWEST_TIMEOUT)
.send()
.await?;
if response