Refactor geo cache persistence into repository + remove raw SQL from tasks/main, update task list

This commit is contained in:
2026-03-17 09:18:05 +01:00
parent 1ce5da9e23
commit c9e688cc52
6 changed files with 230 additions and 78 deletions

View File

@@ -49,12 +49,7 @@ async def _run_re_resolve(app: Any) -> None:
http_session = app.state.http_session
# Fetch all IPs with NULL country_code from the persistent cache.
unresolved_ips: list[str] = []
async with db.execute(
"SELECT ip FROM geo_cache WHERE country_code IS NULL"
) as cursor:
async for row in cursor:
unresolved_ips.append(str(row[0]))
unresolved_ips = await geo_service.get_unresolved_ips(db)
if not unresolved_ips:
log.debug("geo_re_resolve_skip", reason="no_unresolved_ips")