MCPcopy Create free account
hub / github.com/AutoForgeAI/autoforge / cleanup_all_managers

Function cleanup_all_managers

server/services/process_manager.py:548–561  ·  view source on GitHub ↗

Stop all running agents. Called on server shutdown.

()

Source from the content-addressed store, hash-verified

546
547
548async def cleanup_all_managers() -> None:
549 """Stop all running agents. Called on server shutdown."""
550 with _managers_lock:
551 managers = list(_managers.values())
552
553 for manager in managers:
554 try:
555 if manager.status != "stopped":
556 await manager.stop()
557 except Exception as e:
558 logger.warning(f"Error stopping manager for {manager.project_name}: {e}")
559
560 with _managers_lock:
561 _managers.clear()
562
563
564def cleanup_orphaned_locks() -> int:

Callers 1

lifespanFunction · 0.85

Calls 1

stopMethod · 0.45

Tested by

no test coverage detected