We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd0b460 commit 1c206f1Copy full SHA for 1c206f1
backend/src/core/config.py
@@ -46,6 +46,9 @@ class Settings(BaseSettings):
46
POSTGRES_PASSWORD: str
47
POSTGRES_DB: str = ""
48
49
+ CELERY_BROKER_URL: str
50
+ CELERY_RESULT_BACKEND: str
51
+
52
@computed_field # type: ignore[misc]
53
@property
54
def SQLALCHEMY_DATABASE_URI(self) -> PostgresDsn:
backend/src/tasks.py
backend/src/worker.py
@@ -0,0 +1,13 @@
1
+from celery import Celery
2
3
+from src.core.config import settings
4
5
+celery = Celery(
6
+ "worker",
7
+ broker=settings.CELERY_BROKER_URL,
8
+ backend=settings.CELERY_RESULT_BACKEND,
9
+)
10
11
+celery.conf.task_routes = {
12
+ "src.tasks.*": {"queue": "default"},
13
+}
0 commit comments