mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
http: improve prometheus idle timeout
This commit is contained in:
parent
93f8995a72
commit
498481568d
1 changed files with 8 additions and 3 deletions
|
|
@ -104,11 +104,16 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
|
||||||
|
|
||||||
#[cfg(feature = "prometheus")]
|
#[cfg(feature = "prometheus")]
|
||||||
if config.metrics.run_prometheus_endpoint {
|
if config.metrics.run_prometheus_endpoint {
|
||||||
|
let idle_timeout = config
|
||||||
|
.cleaning
|
||||||
|
.connection_cleaning_interval
|
||||||
|
.max(config.cleaning.torrent_cleaning_interval)
|
||||||
|
.max(config.metrics.torrent_count_update_interval)
|
||||||
|
* 2;
|
||||||
|
|
||||||
let handle = aquatic_common::spawn_prometheus_endpoint(
|
let handle = aquatic_common::spawn_prometheus_endpoint(
|
||||||
config.metrics.prometheus_endpoint_address,
|
config.metrics.prometheus_endpoint_address,
|
||||||
Some(Duration::from_secs(
|
Some(Duration::from_secs(idle_timeout)),
|
||||||
config.cleaning.torrent_cleaning_interval * 2,
|
|
||||||
)),
|
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
join_handles.push((WorkerType::Prometheus, handle));
|
join_handles.push((WorkerType::Prometheus, handle));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue