优化ip库获取逻辑

This commit is contained in:
咕谷酱
2025-09-19 17:03:45 +08:00
parent 08ff35509e
commit b834799a2d
2 changed files with 15 additions and 1 deletions

View File

@@ -20,8 +20,9 @@ async def init_geoip():
logger.info("[GeoIP] Initializing GeoIP database...")
# Run the synchronous update method in a background thread
# force=False means only download if files don't exist or are expired
loop = asyncio.get_event_loop()
await loop.run_in_executor(None, geoip.update)
await loop.run_in_executor(None, lambda: geoip.update(force=False))
logger.info("[GeoIP] GeoIP database initialization completed")
except Exception as e: