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 de582d4Copy full SHA for de582d4
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,12 @@
1
+from celery import Celery
2
+from src.core.config import settings
3
4
+celery = Celery(
5
+ "worker",
6
+ broker=settings.CELERY_BROKER_URL,
7
+ backend=settings.CELERY_RESULT_BACKEND
8
+)
9
10
+celery.conf.task_routes = {
11
+ "src.tasks.*": {"queue": "default"},
12
+}
0 commit comments