Skip to content

Commit de582d4

Browse files
committed
Add celery conf
1 parent bd0b460 commit de582d4

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

backend/src/core/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class Settings(BaseSettings):
4646
POSTGRES_PASSWORD: str
4747
POSTGRES_DB: str = ""
4848

49+
CELERY_BROKER_URL: str
50+
CELERY_RESULT_BACKEND: str
51+
4952
@computed_field # type: ignore[misc]
5053
@property
5154
def SQLALCHEMY_DATABASE_URI(self) -> PostgresDsn:

backend/src/tasks.py

Whitespace-only changes.

backend/src/worker.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)