mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
Implement cleanup guard to prevent multiple executions on exit
- Introduced a new cleanup function that ensures terminal and browser sessions are cleaned up only once during application exit. - Updated atexit registration to use the new cleanup function, enhancing resource management and preventing potential issues from multiple cleanup calls. - Modified terminal cleanup messaging to only display when environments are cleaned, improving user feedback.
This commit is contained in:
parent
45a8098d3a
commit
01a3a6ab0d
2 changed files with 23 additions and 15 deletions
|
|
@ -1406,7 +1406,8 @@ def cleanup_all_environments():
|
|||
except:
|
||||
pass
|
||||
|
||||
print(f"[Terminal Cleanup] Cleaned {cleaned} environments")
|
||||
if not os.getenv("HERMES_QUIET") and cleaned > 0:
|
||||
print(f"[Terminal Cleanup] Cleaned {cleaned} environments")
|
||||
return cleaned
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue