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 | 0bb3924836205a0364aaf0959c7cf387db004794 (patch) | |
| tree | 6ed4dd3e25b5138b735dc308a585fc85b5b91640 /src/api/dashboard/mod.rs | |
| parent | 77e82b5f023a02ec05419a9f18ee600251bbb415 (diff) | |
unify closing logic
Diffstat (limited to 'src/api/dashboard/mod.rs')
| -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)) |
