feat(#343): route container restart through rebuild queue
This commit is contained in:
parent
817d94023d
commit
dce2bd0686
4 changed files with 35 additions and 21 deletions
|
|
@ -2720,15 +2720,15 @@ async fn post_restart(State(state): State<AppState>, AxumPath(name): AxumPath<St
|
|||
if let Some(reject) = guard_agent_name(&state, &logical).await {
|
||||
return reject;
|
||||
}
|
||||
lifecycle_action(
|
||||
&state,
|
||||
&name,
|
||||
crate::coordinator::TransientKind::Restarting,
|
||||
"restart",
|
||||
|n| async move { lifecycle::restart(&n).await },
|
||||
|s, n| s.coord.kick_agent(n, "container restarted"),
|
||||
)
|
||||
.await
|
||||
state.coord.rebuild_queue.enqueue(
|
||||
crate::rebuild_queue::QueueKind::Restart,
|
||||
logical,
|
||||
crate::rebuild_queue::QueueSource::Manual,
|
||||
"manual via dashboard ↺ R3START button".to_owned(),
|
||||
None,
|
||||
);
|
||||
state.coord.emit_rebuild_queue_snapshot();
|
||||
(StatusCode::OK, "ok").into_response()
|
||||
}
|
||||
|
||||
async fn post_start(State(state): State<AppState>, AxumPath(name): AxumPath<String>) -> Response {
|
||||
|
|
|
|||
Loading…
Reference in a new issue