File tree Expand file tree Collapse file tree 3 files changed +12
-20
lines changed Expand file tree Collapse file tree 3 files changed +12
-20
lines changed Original file line number Diff line number Diff line change 1
1
from celery import Celery
2
2
from dependency_injector .containers import DynamicContainer
3
3
from dependency_injector .providers import Object
4
- from domains import init_celery , init_domains
5
4
from pydantic import BaseModel , ConfigDict
6
5
6
+ from .celery import init_celery
7
7
from .config import AppConfig
8
8
from .di_container import Container
9
9
from .logs import init_logger
@@ -22,7 +22,6 @@ def application_init(app_config: AppConfig) -> InitReference:
22
22
config = Object (app_config ),
23
23
)
24
24
init_logger (app_config )
25
- init_domains (app_config )
26
25
init_storage ()
27
26
celery = init_celery (app_config )
28
27
Original file line number Diff line number Diff line change
1
+ from celery import Celery
2
+
3
+ from .config import AppConfig
4
+
5
+
6
+ def init_celery (config : AppConfig ) -> Celery :
7
+ celery_app = Celery (f"{ config .APP_NAME } -celery" )
8
+ celery_app .config_from_object (config .CELERY )
9
+ celery_app .autodiscover_tasks ()
10
+
11
+ return celery_app
Original file line number Diff line number Diff line change 1
- from bootstrap .config import AppConfig
2
- from bootstrap .di_container import Container
3
- from celery import Celery
4
- from dependency_injector .providers import Object
5
-
6
-
7
- def init_domains (config : AppConfig ):
8
- Container (
9
- config = Object (config ),
10
- )
11
-
12
-
13
- def init_celery (config : AppConfig ) -> Celery :
14
- celery_app = Celery (f"{ config .APP_NAME } -celery" )
15
- celery_app .config_from_object (config .CELERY )
16
- celery_app .autodiscover_tasks ()
17
-
18
- return celery_app
You can’t perform that action at this time.
0 commit comments