INNER CODE UNIT · Python
_periodic_stuck_sweep
KatrielMoses/voidaccess · api/main.py:304
async def _periodic_stuck_sweep() -> None:
"""Background task: every SWEEP_INTERVAL_SECONDS, sweep stuck rows.
Runs until cancelled by the lifespan teardown. Sleeps in a loop so
cancelling the task is the only stop signal — never raises.
"""
try:
while True:
await asyncio.sleep(SWEEP_INTERVAL_SECONDS)
try:
await _sweep_stuck_investigations(
cutoff_minutes=INVESTIGATION_HARD_TIMEOUT_MINUTES,
)
except asyncio.CancelledError:
raise
except Exception as exc:
logger.warning("Periodic stuck-investigation sweep iteration failed: %s", exc)
except asyncio.CancelledError: