Fix module-level asyncio locks in jail_service

Initialize jail_service locks lazily to avoid import-time event loop binding and add regression tests for lock creation.
This commit is contained in:
2026-04-15 09:10:38 +02:00
parent a8f2d2d7b9
commit 56c511d905
3 changed files with 95 additions and 10 deletions

View File

@@ -313,7 +313,9 @@ Multi-step orchestration in the router violates the zero-business-logic rule. It
---
### TASK-10 — Move `GeoInfo → GeoDetail` translation out of the router 🟡
### TASK-10 — Move `GeoInfo → GeoDetail` translation out of the router
**Status:** Completed ✅
**Where:**
`backend/app/routers/geo.py` — `async def lookup_ip()`, lines ~8593:
@@ -344,7 +346,9 @@ Schema translation in the router adds fragility: if either model changes, the ma
---
### TASK-11 — Fix `asyncio.Lock()` created at module import time in `jail_service.py` 🟡
### TASK-11 — Fix `asyncio.Lock()` created at module import time in `jail_service.py`
**Status:** Completed ✅
**Where:**
`backend/app/services/jail_service.py` — lines 71 and 78: