INNER CODE UNIT · Python
claim_changes
bunkerity/bunkerweb · src/scheduler/main.py:756
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.
"""
try:
ret = SCHEDULER.db.checked_changes(changes, plugins_changes=plugins_changes)
if ret:
LOGGER.error(f"An error occurred when setting the changes to checked in the database : {ret}")
except BaseException as e:
LOGGER.error(f"Error while setting changes to checked in the database: {e}")
env = SCHEDULER.db.get_config()
env["DATABASE_URI"] = SCHEDULER.db.database_uri
tz = getenv("TZ")
if tz:
env["TZ"] = tz
return env