From c070bef0c1005366104176c1fc5af8b8f63cf01f Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 3 Nov 2026 00:26:42 +0100 Subject: add stream heartbeat --- src/config/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/config') diff --git a/src/config/mod.rs b/src/config/mod.rs index 628f0ff..a6f70aa 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -249,6 +249,13 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[ None, "Where people reach this node's dashboard (http:// or https://, e.g. behind a reverse proxy). Published in the swarm's member list: the other nodes' dashboards open it on a double-click on this node. A build without the dashboard feature warns and publishes none (removing one published before).", ), + option( + "stream-heartbeat", + Kind::Duration, + "DURATION", + Some("30s"), + "How often GET /stream sends a blank line while nothing changes, so proxies in front keep it open: below their read timeout (nginx's proxy_read_timeout, 60 s by default). 0: never.", + ), option( "keepalive", Kind::Duration, @@ -550,6 +557,11 @@ pub(crate) struct Settings { pub(crate) dashboard_url: Option, #[serde(default = "default_keepalive", with = "crate::units::duration_option")] pub(crate) keepalive: Duration, + #[serde( + default = "default_stream_heartbeat", + with = "crate::units::duration_option" + )] + pub(crate) stream_heartbeat: Duration, #[serde( default, deserialize_with = "crate::units::optional_duration", @@ -664,6 +676,9 @@ fn default_document_rewrite() -> Duration { fn default_keepalive() -> Duration { Duration::from_secs(60) } +fn default_stream_heartbeat() -> Duration { + Duration::from_secs(30) +} fn default_neighbours() -> usize { 12 } -- cgit v1.3.1