diff options
| author | tv <tv@krebsco.de> | 2026-10-31 03:54:19 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 03:54:19 +0100 |
| commit | 4d09dcfcd7432ab303f848342d2f762b57b7c693 (patch) | |
| tree | d2396328d6ce3ac0e7a251aa582e7215d1e02bf5 /src/api/dashboard | |
| parent | d4e6228a7d81b99ba3607eeb76c31f5b8c2f8d50 (diff) | |
unify closing logic
Diffstat (limited to 'src/api/dashboard')
| -rw-r--r-- | src/api/dashboard/mod.rs | 5 |
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)) |
