Guard geo_service.init_geoip against repeated initialization
This commit is contained in:
@@ -66,6 +66,8 @@ Reference: `Docs/Refactoring.md` for full analysis of each issue.
|
||||
|
||||
### 4. Add Path Validation to `_geoip_reader` Initialization
|
||||
|
||||
**Status:** Completed.
|
||||
|
||||
**Where:** `backend/app/services/geo_service.py` — the `init_geoip()` function (around line 249) sets the module-level `_geoip_reader` without acquiring `_cache_lock`.
|
||||
|
||||
**Goal:** Add a clear code comment documenting the startup-only assumption: `init_geoip()` must only be called during application startup (from `startup.py`) before request handling begins. Optionally, add an assertion or guard that prevents double-initialization.
|
||||
|
||||
Reference in New Issue
Block a user