fix: add /app to sys.path for Celery forked workers importing services.avatar

This commit is contained in:
jlightner 2026-04-03 05:58:14 +00:00
parent 44e5905bd7
commit a16559e668

View file

@ -2388,7 +2388,11 @@ def fetch_creator_avatar(creator_id: str) -> dict:
avatar_url/avatar_source/avatar_fetched_at columns if a confident
match is found. Returns a status dict.
"""
import sys
from datetime import datetime, timezone
# Ensure /app is on sys.path for forked Celery workers
if "/app" not in sys.path:
sys.path.insert(0, "/app")
from services.avatar import lookup_avatar
session = _get_sync_session()