Skip to content
Snippets Groups Projects
Unverified Commit 2070381e authored by İsmail Karslı's avatar İsmail Karslı Committed by GitHub
Browse files

Add upload_timeout to PictrsConfig (#4159)

* Add upload timeout to PictrsConfig

* Bad space :thinking:

* Update PictrsConfig upload timeout to include units.
parent 525359f7
No related branches found
No related tags found
No related merge requests found
......@@ -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)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment