This commit is contained in:
müde 2026-05-15 02:02:20 +02:00
parent 1333532d3f
commit fcd6563887
3 changed files with 5 additions and 10 deletions

View file

@ -4,9 +4,7 @@
//! shape they want (HTTP redirect vs JSON). //! shape they want (HTTP redirect vs JSON).
use anyhow::Result; use anyhow::Result;
use hive_sh4re::{ use hive_sh4re::{ApprovalStatus, HelperEvent, MANAGER_AGENT, Message, SYSTEM_SENDER};
ApprovalStatus, HelperEvent, MANAGER_AGENT, Message, SYSTEM_SENDER,
};
use crate::coordinator::Coordinator; use crate::coordinator::Coordinator;
use crate::lifecycle; use crate::lifecycle;

View file

@ -9,6 +9,7 @@ use std::path::Path;
use std::sync::Arc; use std::sync::Arc;
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use axum::extract::Form;
use axum::{ use axum::{
Router, Router,
extract::{Path as AxumPath, State}, extract::{Path as AxumPath, State},
@ -19,7 +20,6 @@ use axum::{
}, },
routing::{get, post}, routing::{get, post},
}; };
use axum::extract::Form;
use hive_sh4re::{Approval, MANAGER_AGENT, Message}; use hive_sh4re::{Approval, MANAGER_AGENT, Message};
use serde::Deserialize; use serde::Deserialize;
use tokio_stream::wrappers::BroadcastStream; use tokio_stream::wrappers::BroadcastStream;
@ -215,9 +215,7 @@ fn gc_orphans(coord: &Coordinator, approvals: Vec<Approval>) -> Vec<Approval> {
if Coordinator::agent_proposed_dir(&a.agent).exists() { if Coordinator::agent_proposed_dir(&a.agent).exists() {
true true
} else { } else {
let _ = coord let _ = coord.approvals.mark_failed(a.id, "agent state dir missing");
.approvals
.mark_failed(a.id, "agent state dir missing");
tracing::info!(id = a.id, agent = %a.agent, "auto-failed orphan approval"); tracing::info!(id = a.id, agent = %a.agent, "auto-failed orphan approval");
false false
} }

View file

@ -296,9 +296,8 @@ fn set_resource_limits(container: &str) -> Result<()> {
let dir = format!("/run/systemd/system/container@{container}.service.d"); let dir = format!("/run/systemd/system/container@{container}.service.d");
std::fs::create_dir_all(&dir).with_context(|| format!("create {dir}"))?; std::fs::create_dir_all(&dir).with_context(|| format!("create {dir}"))?;
let path = format!("{dir}/hyperhive-limits.conf"); let path = format!("{dir}/hyperhive-limits.conf");
let content = format!( let content =
"[Service]\nMemoryMax={DEFAULT_MEMORY_MAX}\nCPUQuota={DEFAULT_CPU_QUOTA}\n", format!("[Service]\nMemoryMax={DEFAULT_MEMORY_MAX}\nCPUQuota={DEFAULT_CPU_QUOTA}\n",);
);
std::fs::write(&path, content).with_context(|| format!("write {path}"))?; std::fs::write(&path, content).with_context(|| format!("write {path}"))?;
tracing::info!( tracing::info!(
%path, %path,