📦 chore(core): add Celery configuration files
✨ feat(celery_app.py): add Celery app configuration for langflow with Redis as broker and backend ✨ feat(celeryconfig.py): add Celery configuration file with environment variable support for broker URL and result backend URL
This commit is contained in:
parent
d1a9ed45d7
commit
43ba81c2ee
3 changed files with 14 additions and 0 deletions
0
src/backend/langflow/core/__init__.py
Normal file
0
src/backend/langflow/core/__init__.py
Normal file
7
src/backend/langflow/core/celery_app.py
Normal file
7
src/backend/langflow/core/celery_app.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from celery import Celery
|
||||
|
||||
celery_app = Celery(
|
||||
"langflow", broker="redis://queue:6379/0", backend="redis://queue:6379/0"
|
||||
)
|
||||
# command: celery -A langflow.worker.celery_app worker --loglevel=INFO
|
||||
celery_app.conf.task_routes = {"langflow.worker.tasks.*": {"queue": "langflow"}}
|
||||
7
src/backend/langflow/core/celeryconfig.py
Normal file
7
src/backend/langflow/core/celeryconfig.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# celeryconfig.py
|
||||
import os
|
||||
|
||||
broker_url = os.environ.get("BROKER_URL", "redis://localhost:6379/0")
|
||||
result_backend = os.environ.get("RESULT_BACKEND", "redis://localhost:6379/0")
|
||||
# tasks should be json or pickle
|
||||
accept_content = ["json", "pickle"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue