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.
|
// own kind now.
|
||||||
crate::lifecycle::kill(name).await?;
|
crate::lifecycle::kill(name).await?;
|
||||||
coord.unregister_agent(name);
|
coord.unregister_agent(name);
|
||||||
coord.notify_manager(&hive_sh4re::HelperEvent::Killed {
|
coord
|
||||||
agent: name.to_owned(),
|
.push_todo(
|
||||||
});
|
hive_sh4re::MANAGER_AGENT,
|
||||||
|
"core",
|
||||||
|
Some(format!("killed:{name}")),
|
||||||
|
format!("agent '{name}' killed"),
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
coord.rescan_containers_and_emit().await;
|
coord.rescan_containers_and_emit().await;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,9 +129,15 @@ pub(super) async fn handle_kill(coord: &Arc<Coordinator>, agent: &str, name: &st
|
||||||
.await;
|
.await;
|
||||||
match result {
|
match result {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
coord.notify_manager(&hive_sh4re::HelperEvent::Killed {
|
coord
|
||||||
agent: name.to_owned(),
|
.push_todo(
|
||||||
});
|
hive_sh4re::MANAGER_AGENT,
|
||||||
|
"core",
|
||||||
|
Some(format!("killed:{name}")),
|
||||||
|
format!("agent '{name}' killed"),
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
Response::Ok
|
Response::Ok
|
||||||
}
|
}
|
||||||
Err(e) => Response::Err {
|
Err(e) => Response::Err {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue