hive-c0re: push Killed as a todo, not a broker message
This commit is contained in:
parent
c41d2d201d
commit
1f448a7818
2 changed files with 18 additions and 6 deletions
|
|
@ -429,9 +429,15 @@ async fn run_stop(coord: &Arc<Coordinator>, name: &str) -> Result<()> {
|
|||
// own kind now.
|
||||
crate::lifecycle::kill(name).await?;
|
||||
coord.unregister_agent(name);
|
||||
coord.notify_manager(&hive_sh4re::HelperEvent::Killed {
|
||||
agent: name.to_owned(),
|
||||
});
|
||||
coord
|
||||
.push_todo(
|
||||
hive_sh4re::MANAGER_AGENT,
|
||||
"core",
|
||||
Some(format!("killed:{name}")),
|
||||
format!("agent '{name}' killed"),
|
||||
None,
|
||||
)
|
||||
.await;
|
||||
coord.rescan_containers_and_emit().await;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,9 +129,15 @@ pub(super) async fn handle_kill(coord: &Arc<Coordinator>, agent: &str, name: &st
|
|||
.await;
|
||||
match result {
|
||||
Ok(()) => {
|
||||
coord.notify_manager(&hive_sh4re::HelperEvent::Killed {
|
||||
agent: name.to_owned(),
|
||||
});
|
||||
coord
|
||||
.push_todo(
|
||||
hive_sh4re::MANAGER_AGENT,
|
||||
"core",
|
||||
Some(format!("killed:{name}")),
|
||||
format!("agent '{name}' killed"),
|
||||
None,
|
||||
)
|
||||
.await;
|
||||
Response::Ok
|
||||
}
|
||||
Err(e) => Response::Err {
|
||||
|
|
|
|||
Loading…
Reference in a new issue