Mark async socket handling task done and implement startup cleanup
This commit is contained in:
@@ -56,6 +56,7 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
|
||||
### 6. Update async socket handling
|
||||
- Where found: `backend/app/utils/fail2ban_client.py`, `backend/app/startup.py`
|
||||
- Goal: use modern asyncio APIs (`get_running_loop()`), avoid blocking operations on the event loop, and ensure startup resources are cleaned up if initialization fails.
|
||||
- Status: completed — switched fail2ban socket I/O to `asyncio.to_thread` and added startup cleanup for failed resource initialization.
|
||||
- Possible traps and issues:
|
||||
- `asyncio.get_event_loop()` behavior changed in newer Python versions; this can cause runtime warnings or errors.
|
||||
- Resource leaks can occur if `startup_shared_resources()` fails before the lifespan shutdown path is reached.
|
||||
|
||||
Reference in New Issue
Block a user