mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
fix(gateway): write update-pending state atomically to prevent corruption
This commit is contained in:
parent
cee761ee4a
commit
287ac15efd
1 changed files with 3 additions and 1 deletions
|
|
@ -4872,7 +4872,9 @@ class GatewayRunner:
|
|||
"user_id": event.source.user_id,
|
||||
"timestamp": datetime.now().isoformat(),
|
||||
}
|
||||
pending_path.write_text(json.dumps(pending))
|
||||
_tmp_pending = pending_path.with_suffix(".tmp")
|
||||
_tmp_pending.write_text(json.dumps(pending))
|
||||
_tmp_pending.replace(pending_path)
|
||||
exit_code_path.unlink(missing_ok=True)
|
||||
|
||||
# Spawn `hermes update` detached so it survives gateway restart.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue