feat: add celery & redis for background data processing
This commit is contained in:
16
server/queue/celery_app.py
Normal file
16
server/queue/celery_app.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from celery import Celery
|
||||
|
||||
def create_celery():
|
||||
celery = Celery(
|
||||
"ethnograph",
|
||||
broker="redis://redis:6379/0",
|
||||
backend="redis://redis:6379/0",
|
||||
)
|
||||
celery.conf.task_serializer = "json"
|
||||
celery.conf.result_serializer = "json"
|
||||
celery.conf.accept_content = ["json"]
|
||||
return celery
|
||||
|
||||
celery = create_celery()
|
||||
|
||||
from server.queue import tasks
|
||||
Reference in New Issue
Block a user