dashboard: lifecycle_action helper collapses start/stop/restart/rebuild
five POST handlers (post_kill / post_restart / post_start / post_rebuild) were all repeating the same boilerplate: strip prefix, set_transient, call lifecycle::X, clear_transient, match the result. extract one helper that takes the transient kind, error-message verb, the work body, and an optional 'on success' tail (used by kill to also unregister + emit HelperEvent::Killed). each handler shrinks to a single lifecycle_action(..) call. zero behavior change.
This commit is contained in:
parent
89ccc5e6c5
commit
7b4adea325
3 changed files with 76 additions and 47 deletions
|
|
@ -114,7 +114,6 @@ impl EventStore {
|
|||
out.reverse();
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
@ -172,7 +171,6 @@ impl Bus {
|
|||
};
|
||||
store.recent(HISTORY_CAPACITY).unwrap_or_default()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Default for Bus {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue