INNER CODE UNIT · Python
_render_holding_applying_changes
bunkerity/bunkerweb · src/scheduler/main.py:744
def _render_holding_applying_changes() -> bool:
"""Render inside the APPLYING_CHANGES window, and leave the event alone when it is already held."""
held = not APPLYING_CHANGES.is_set()
if held:
APPLYING_CHANGES.set()
try:
return generate_configs()
finally:
if held:
APPLYING_CHANGES.clear()
def claim_changes(changes: Optional[List[str]] = None, *, plugins_changes=None) -> Dict[str, Any]:
"""Acknowledge pending changes, then return a fresh configuration snapshot.
The order is the whole point: the flags are cleared first, so anything written after this
call is still flagged when the returned snapshot is rendered, and the next tick picks it up.
"""