huskies: merge 778

This commit is contained in:
dave
2026-04-28 09:54:51 +00:00
parent d2d5ef8afa
commit fb5a21cfbb
4 changed files with 240 additions and 7 deletions
-5
View File
@@ -186,7 +186,6 @@ pub async fn generate_join_token(state: &GatewayState) -> String {
///
/// Validates and consumes the token, then writes the agent's node presence
/// and metadata to the CRDT collection. Returns the newly-created node view.
#[allow(dead_code)]
pub async fn register_agent(
state: &GatewayState,
token: &str,
@@ -225,7 +224,6 @@ pub async fn register_agent(
/// Tombstone a registered agent in the CRDT (set `alive = false`).
///
/// Returns `true` if the node was found and tombstoned.
#[allow(dead_code)]
pub fn remove_agent(node_id: &str) -> bool {
let nodes = crate::crdt_state::read_all_node_presence().unwrap_or_default();
let Some(node) = nodes.iter().find(|n| n.node_id == node_id) else {
@@ -240,7 +238,6 @@ pub fn remove_agent(node_id: &str) -> bool {
///
/// Validates that the project exists in the gateway config (when assigning),
/// then writes the updated `assigned_project` field to the CRDT.
#[allow(dead_code)]
pub async fn assign_agent(
state: &GatewayState,
node_id: &str,
@@ -275,7 +272,6 @@ pub async fn assign_agent(
}
/// Update an agent's heartbeat via CRDT. Returns `true` if the node was found.
#[allow(dead_code)]
pub fn heartbeat_agent(id: &str) -> bool {
let now = chrono::Utc::now().timestamp() as f64;
let nodes = crate::crdt_state::read_all_node_presence().unwrap_or_default();
@@ -287,7 +283,6 @@ pub fn heartbeat_agent(id: &str) -> bool {
}
/// List all registered build agents from the CRDT nodes collection.
#[allow(dead_code)]
pub fn list_agents() -> Vec<NodePresenceView> {
crate::crdt_state::read_all_node_presence()
.unwrap_or_default()