Skip to content

Commit 266521f

Browse files
committed
Add application name to config
1 parent 4a69dcb commit 266521f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class CeleryConfig(BaseModel):
4747
class AppConfig(BaseSettings):
4848
model_config = SettingsConfigDict(env_nested_delimiter="__")
4949

50+
APP_NAME: str = "bootstrap"
5051
CELERY: CeleryConfig = CeleryConfig()
5152
DEBUG: bool = False
5253
ENVIRONMENT: TYPE_ENVIRONMENT = "local"

domains/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def init_domains(config: AppConfig):
1212

1313

1414
def init_celery(config: AppConfig) -> Celery:
15-
celery_app = Celery()
15+
celery_app = Celery(f"{config.APP_NAME}-celery")
1616
celery_app.config_from_object(config.CELERY)
1717
celery_app.autodiscover_tasks()
1818

http_app/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ def create_app(
1818
app_config = test_config or AppConfig()
1919
init_logger(app_config)
2020
init_domains(app_config)
21-
app = FastAPI(debug=app_config.DEBUG)
21+
app = FastAPI(
22+
debug=app_config.DEBUG,
23+
title=app_config.APP_NAME,
24+
)
2225
init_exception_handlers(app)
2326

2427
init_storage()

0 commit comments

Comments
 (0)