INNER CODE UNIT · Python
_fetch_favicons_in_background
dev-lu/osint_toolkit · backend/main.py:67
async def _fetch_favicons_in_background() -> None:
"""Fetch missing feed favicons in the background after startup"""
from app.features.newsfeed.service.icon_management_service import bulk_fetch_favicons_parallel
try:
async with managed_session() as db:
await bulk_fetch_favicons_parallel(db)
except Exception as e:
logger.error("Background favicon fetch failed: %s", e)
async def handle_application_startup() -> None:
"""Handle application startup tasks"""
logger.info("Application starting up...")
try:
await _create_database_tables()
await _run_application_defaults()
asyncio.create_task(_fetch_favicons_in_background())