mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-21 20:13:05 +00:00
Add upload_timeout to PictrsConfig (#4159)
* Add upload timeout to PictrsConfig
* Bad space 🤔
* Update PictrsConfig upload timeout to include units.
This commit is contained in:
parent
525359f7c5
commit
2070381e81
3 changed files with 7 additions and 1 deletions
|
@ -52,6 +52,8 @@
|
|||
# hotlinking is allowed. If that is the case for your instance, make sure that this setting is
|
||||
# disabled.
|
||||
cache_external_link_previews: true
|
||||
# Timeout for uploading images to pictrs (in seconds)
|
||||
upload_timeout: 30
|
||||
}
|
||||
# Email sending configuration. All options except login/password are mandatory
|
||||
email: {
|
||||
|
|
|
@ -107,7 +107,7 @@ async fn upload(
|
|||
client_req = client_req.header("X-Forwarded-For", addr.to_string())
|
||||
};
|
||||
let res = client_req
|
||||
.timeout(Duration::from_secs(30))
|
||||
.timeout(Duration::from_secs(pictrs_config.upload_timeout))
|
||||
.body(Body::wrap_stream(make_send(body)))
|
||||
.send()
|
||||
.await
|
||||
|
|
|
@ -89,6 +89,10 @@ pub struct PictrsConfig {
|
|||
/// disabled.
|
||||
#[default(true)]
|
||||
pub cache_external_link_previews: bool,
|
||||
|
||||
/// Timeout for uploading images to pictrs (in seconds)
|
||||
#[default(30)]
|
||||
pub upload_timeout: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Clone, SmartDefault, Document)]
|
||||
|
|
Loading…
Reference in a new issue