Watch
0
0
Fork
You've already forked hyperhive
0

drop the hive-side matrix code: sweep, hivectl matrix and the apiUrl option

This commit is contained in:
damocles 2026-10-28 22:16:16 +01:00 • committed by mara
commit 6dbb18b6d4

View file

@ -26,7 +26,6 @@ mod gateway_nginx;
mod job_queue;
mod lifecycle;
mod loose_ends;
mod matrix;
mod meta;
mod meta_rev;
mod migrate;
@ -233,7 +232,7 @@ async fn cmd_serve(
socket: &std::path::Path,
) -> Result<()> {
// Move any host-side state still at the legacy flat layout into its
// subdir (`db/`, `forge/`, `matrix/`, `run/`) BEFORE opening the
// subdir (`db/`, `forge/`, `run/`) BEFORE opening the
// broker db — the broker + build-logs dbs are among the relocated
// files. Idempotent; a no-op once migrated.
crate::paths::relocate_legacy_state();
@ -307,29 +306,6 @@ async fn cmd_serve(
}
}
});
// Matrix sweep (`matrix::ensure_all`): the hive's own sender token, kept
// on disk for `hivectl matrix invite`. It
// creates no accounts or tokens — swarm-controller mints those.
// No-op when the hive-matrix container isn't running. Re-submitted every
// 30 minutes; the startup pass is the boot `MatrixSweep` node.
let mut matrix_shutdown = coord.shutdown_rx();
let matrix_coord = coord.clone();
tokio::spawn(async move {
let interval = std::time::Duration::from_mins(30);
loop {
tokio::select! {
() = tokio::time::sleep(interval) => submit_periodic_sweep(
&matrix_coord,
&job_queue::NodeKind::MatrixSweep,
job_queue::templates::matrix_sweep,
),
_ = matrix_shutdown.changed() => {
tracing::info!("matrix ensure_all: shutdown signal received");
break;
}
}
}
});
// Periodic broker vacuum: drop fully-acked messages older
// than 30 days. Delivered-but-unacked rows (recoverable via
// requeue_inflight) and undelivered rows are always kept.