@mytec: iter2.4.2 start

This commit is contained in:
2026-02-01 12:02:52 +02:00
parent fa7378cf3f
commit 4026233b21
10 changed files with 724 additions and 8 deletions

View File

@@ -1,3 +1,5 @@
import os
import asyncio
import multiprocessing as mp
from fastapi import APIRouter
@@ -42,3 +44,17 @@ async def get_system_info():
"gpu": gpu_info,
"gpu_available": gpu_info.get("available", False),
}
@router.post("/shutdown")
async def shutdown():
"""Graceful shutdown endpoint. Kills worker processes and exits."""
from app.services.parallel_coverage_service import _kill_worker_processes
killed = _kill_worker_processes()
# Schedule hard exit after response is sent
loop = asyncio.get_event_loop()
loop.call_later(0.5, lambda: os._exit(0))
return {"status": "shutting down", "workers_killed": killed}