From 4d09dcfcd7432ab303f848342d2f762b57b7c693 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 31 Oct 2026 03:54:19 +0100 Subject: unify closing logic --- src/api/dashboard/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/api/dashboard/mod.rs') diff --git a/src/api/dashboard/mod.rs b/src/api/dashboard/mod.rs index f0cbbfd..0a502a3 100644 --- a/src/api/dashboard/mod.rs +++ b/src/api/dashboard/mod.rs @@ -381,8 +381,9 @@ fn merge_patch(old: &JsonValue, new: &JsonValue) -> Option { } /// The dashboard's routes (authenticated, as the rest of `/admin`), with their hub. -/// `closing` turns true when the node stops (`Hub::closing`). -pub(crate) fn router(state: AppState, closing: watch::Receiver) -> Router { +pub(crate) fn router(state: AppState) -> Router { + // Its streams end when the node shuts down (`AppState::closing`). + let closing = state.closing.subscribe(); Router::new() .route("/admin/dashboard", get(page_html)) .route("/admin/dashboard/state", get(current_state)) -- cgit v1.3.1