namespace ZB.MOM.WW.OtOpcUa.Configuration.LocalCache;
///
/// Thread-safe UsingStaleConfig signal per Phase 6.1 Stream D.3. Flips true whenever
/// a read falls back to a sealed cache snapshot; flips false on the next successful central-DB
/// round-trip. Surfaced on /healthz body and on the Admin /hosts page.
///
public sealed class StaleConfigFlag
{
private int _stale;
/// True when the last config read was served from the sealed cache, not the central DB.
public bool IsStale => Volatile.Read(ref _stale) != 0;
/// Mark the current config as stale (a read fell back to the cache).
public void MarkStale() => Volatile.Write(ref _stale, 1);
/// Mark the current config as fresh (a central-DB read succeeded).
public void MarkFresh() => Volatile.Write(ref _stale, 0);
}