aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/dashboard/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 03:54:19 +0100
committertv <tv@krebsco.de>2026-10-31 03:54:19 +0100
commit4d09dcfcd7432ab303f848342d2f762b57b7c693 (patch)
treed2396328d6ce3ac0e7a251aa582e7215d1e02bf5 /src/api/dashboard/mod.rs
parentd4e6228a7d81b99ba3607eeb76c31f5b8c2f8d50 (diff)
unify closing logic
Diffstat (limited to 'src/api/dashboard/mod.rs')
-rw-r--r--src/api/dashboard/mod.rs5
1 files changed, 3 insertions, 2 deletions
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<JsonValue> {
}
/// 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<bool>) -> Router<AppState> {
+pub(crate) fn router(state: AppState) -> Router<AppState> {
+ // 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))