Play around with AI avatars - nothing serious yet

This commit is contained in:
Oliver Falk
2025-09-17 13:55:12 +02:00
parent a641572e4b
commit 493f9405dd
21 changed files with 2534 additions and 5 deletions

View File

@@ -296,6 +296,33 @@ TRUSTED_DEFAULT_URLS = list(map(map_legacy_config, TRUSTED_DEFAULT_URLS))
BLUESKY_IDENTIFIER = os.environ.get("BLUESKY_IDENTIFIER", None)
BLUESKY_APP_PASSWORD = os.environ.get("BLUESKY_APP_PASSWORD", None)
# Celery Configuration
# Try Redis first, fallback to memory broker for development
try:
import redis
redis.Redis(host="localhost", port=6379, db=0).ping()
CELERY_BROKER_URL = "redis://localhost:6379/0"
except Exception: # pylint: disable=broad-except
# Fallback to memory broker for development
CELERY_BROKER_URL = "memory://"
print("Warning: Redis not available, using memory broker for development")
CELERY_RESULT_BACKEND = "django-db"
CELERY_ACCEPT_CONTENT = ["json"]
CELERY_TASK_SERIALIZER = "json"
CELERY_RESULT_SERIALIZER = "json"
CELERY_TIMEZONE = "UTC"
CELERY_TASK_TRACK_STARTED = True
CELERY_TASK_TIME_LIMIT = 300 # 5 minutes
CELERY_TASK_SOFT_TIME_LIMIT = 240 # 4 minutes
CELERY_WORKER_PREFETCH_MULTIPLIER = 1
CELERY_TASK_ACKS_LATE = True
CELERY_RESULT_EXPIRES = 3600 # 1 hour
CELERY_WORKER_CONCURRENCY = (
1 # Max 1 parallel avatar generation task for local development
)
# This MUST BE THE LAST!
if os.path.isfile(os.path.join(BASE_DIR, "config_local.py")):
from config_local import * # noqa # flake8: noqa # NOQA # pragma: no cover