diff --git a/ROADMAP.md b/ROADMAP.md index b25a995..4c32f9b 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -348,6 +348,12 @@ PPF (Proxy Fetcher) is a Python 2 proxy scraping and validation framework design - [x] Thread-safe with lock for concurrent access - [x] Proper LRU eviction (move_to_end on hits, popitem oldest when full) +### Database Context Manager (Done) +- [x] Refactored all DB operations to use `_db_context()` context manager +- [x] Connections guaranteed to close even on exceptions +- [x] Removed deprecated `_prep_db()` and `_close_db()` methods +- [x] `fetch_rows()` now accepts db parameter for cleaner dependency injection + --- ## Technical Debt diff --git a/TODO.md b/TODO.md index 393e58d..d531826 100644 --- a/TODO.md +++ b/TODO.md @@ -656,6 +656,13 @@ becomes a constraint. - Process memory from /proc/self/status - GC statistics and collection counts +### [x] Database Context Manager Refactoring +- Refactored all DB operations to use `_db_context()` context manager +- `prepare_jobs()`, `submit_collected()`, `_run()` now use `with self._db_context() as db:` +- `fetch_rows()` accepts db parameter for dependency injection +- Removed deprecated `_prep_db()` and `_close_db()` methods +- Connections guaranteed to close even on exceptions + --- ## Deployment Troubleshooting Log