Watch
0
0
Fork
You've already forked hyperhive
0

serialise the agent-sockets and gateway publishes and give each its own tmp file

Closes #6094
This commit is contained in:
atlas 2026-11-06 02:53:26 +01:00 • committed by mara
commit febac5eaa9

View file

@ -9,9 +9,12 @@ use std::path::Path;
use anyhow::{Context, Result, bail};
use tokio::sync::Mutex;
/// Serialises [`refresh`]: `topology.json` is read, changed and written back,
/// so two concurrent refreshes would lose one of the changes.
static REFRESH: Mutex<()> = Mutex::const_new(());
/// Serialises [`refresh`] and each tick of the 10-second poll in
/// `workers::agent_sockets`. `topology.json` is read, changed and written
/// back, so two concurrent refreshes would lose one of the changes; the poll
/// holds it across list-and-write so it cannot publish an older agent list
/// over one `refresh` just wrote.
pub(crate) static REFRESH: Mutex<()> = Mutex::const_new(());
/// Bring the host-side files in line with `agents`, the live agent set.
///