hive-c0re: drop needless async from pause_many (clippy pedantic)

This commit is contained in:
damocles 2026-08-11 22:48:25 +02:00 committed by mara
commit 2bf0d73c8b
2 changed files with 5 additions and 7 deletions

View file

@ -342,14 +342,13 @@ pub(crate) fn pause_nodes(builder: &JobBuilder, agents: &[String]) -> Vec<hive_j
/// Pause `agents` in a **single** DAG. Unlike `stop`/`start`/`restart`,
/// this needs no live-state read first — `Coordinator::set_paused`
/// works on a stopped container too (the marker is sticky), so there's
/// no `running`/`stale` branch to resolve async before building.
/// no `running`/`stale` branch to resolve, and nothing here actually
/// awaits anything (`insert_job` and `emit_rebuild_queue_snapshot` are
/// both sync) — plain `fn`, not `async fn`, unlike its siblings.
///
/// # Errors
/// Propagates a graph-insert error.
pub async fn pause_many(
coord: &Arc<Coordinator>,
agents: &[String],
) -> anyhow::Result<Vec<NodeId>> {
pub fn pause_many(coord: &Arc<Coordinator>, agents: &[String]) -> anyhow::Result<Vec<NodeId>> {
let targets: Vec<String> = agents.to_vec();
let ids = coord.job_queue.insert_job(|b| pause_nodes(b, &targets))?;
coord.emit_rebuild_queue_snapshot();

View file

@ -358,8 +358,7 @@ async fn handle_set_paused(
coord.rescan_containers_and_emit().await;
return HostResponse::success();
}
match crate::job_queue::power::pause_many(coord, std::slice::from_ref(&name.to_string())).await
{
match crate::job_queue::power::pause_many(coord, std::slice::from_ref(&name.to_string())) {
Ok(ids) => {
tracing::info!(%name, "agent pause queued");
HostResponse::queued(ids.into_iter().map(hive_jobq::NodeId::get).collect())