Watch
0
0
Fork
You've already forked hyperhive
0

remove what no longer has a reader: build-log store, dashboard sent/delivered events, graph resource dep

This commit is contained in:
atlas 2026-11-13 10:08:19 +01:00 • committed by mara
commit 49266e4410

View file

@ -48,8 +48,7 @@ pub const STATE_ROOT: &str = "/var/lib/hyperhive";
pub const RUNTIME_ROOT: &str = "/run/hyperhive";
/// Default broker db path (`db/broker.sqlite`). Exposed as a `&str` for
/// the `--broker-db` clap `default_value`; `build_logs.sqlite` is placed
/// alongside it (the build-logs store keys off the broker db's parent).
/// the `--broker-db` clap `default_value`.
pub const BROKER_DB: &str = "/var/lib/hyperhive/db/broker.sqlite";
#[must_use]
@ -57,7 +56,7 @@ pub fn state_root() -> PathBuf {
PathBuf::from(STATE_ROOT)
}
/// `db/` — sqlite databases (broker, build logs).
/// `db/` — sqlite databases (broker).
#[must_use]
pub fn db_dir() -> PathBuf {
state_root().join("db")
@ -210,15 +209,13 @@ pub fn agent_runtime_dir(name: &str) -> PathBuf {
/// rename-based: a move only happens when the old path exists and the
/// new one doesn't, so re-runs are no-ops.
///
/// Must run **before** the broker db is opened (the broker + build-logs
/// dbs are relocated here). Safe because those dbs use rollback-journal
/// Must run **before** the broker db is opened (the broker db is relocated here). Safe because it uses rollback-journal
/// mode (no `-wal`/`-shm` sidecars after a clean shutdown), and a rename
/// within the same filesystem is atomic.
pub fn relocate_legacy_state() {
let root = state_root();
let moves: [(&str, PathBuf); 3] = [
let moves: [(&str, PathBuf); 2] = [
("broker.sqlite", db_dir().join("broker.sqlite")),
("build_logs.sqlite", db_dir().join("build_logs.sqlite")),
("agent-sockets.json", agent_sockets_file()),
];
for (old_rel, new) in &moves {