build(env): extract Redis URL into env file

This could allow one to connect to a remote Redis instance with a powerful GPU, allowing one to offload the NLP work.
This commit is contained in:
2026-03-22 14:41:15 +00:00
parent 97e897c240
commit 7716ee0bff
2 changed files with 13 additions and 3 deletions

View File

@@ -1,10 +1,15 @@
from celery import Celery
from dotenv import load_dotenv
from server.utils import get_env
load_dotenv()
REDIS_URL = get_env("REDIS_URL")
def create_celery():
celery = Celery(
"ethnograph",
broker="redis://redis:6379/0",
backend="redis://redis:6379/0",
broker=REDIS_URL,
backend=REDIS_URL,
)
celery.conf.task_serializer = "json"
celery.conf.result_serializer = "json"