serialise the agent-sockets and gateway publishes and give each its own tmp file
Closes #6094
This commit is contained in:
parent
970ee83a93
commit
febac5eaa9
1 changed files with 128 additions and 39 deletions
|
|
@ -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.
|
||||
///
|
||||
|
|
|
|||
Loading…
Reference in a new issue