0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-18 01:48:27 +02:00

modules/media/media: Add conf item for download timeout.

This commit is contained in:
Jason Volk 2018-09-04 20:34:10 -07:00
parent 1edab7bb15
commit 499e725e73

View file

@ -214,6 +214,13 @@ catch(const ircd::server::unavailable &e)
};
}
conf::item<seconds>
media_download_timeout
{
{ "name", "ircd.media.download.timeout" },
{ "default", 15L },
};
std::pair<http::response::head, unique_buffer<mutable_buffer>>
download(const mutable_buffer &head_buf,
const string_view &server,
@ -253,8 +260,7 @@ download(const mutable_buffer &head_buf,
remote, { out_head }, { in_head, in_content }, opts
};
//TODO: conf
if(!remote_request.wait(seconds(10), std::nothrow))
if(!remote_request.wait(seconds(media_download_timeout), std::nothrow))
throw http::error
{
http::REQUEST_TIMEOUT