Skip to content

Commit eb56290

Browse files
committed
main.py changes
1 parent 89938fd commit eb56290

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/app/main.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from app.core.database import Base
55
from app.core.database import async_engine as engine
6-
from app.core.config import settings, DatabaseSettings, RedisCacheSettings
6+
from app.core.config import settings, DatabaseSettings, RedisCacheSettings, AppSettings
77
from app.api import router
88
from app.core import cache
99

@@ -25,12 +25,15 @@ async def close_redis_cache_pool():
2525

2626
# -------------- application --------------
2727
def create_application() -> FastAPI:
28-
application = FastAPI(
29-
title=settings.APP_NAME,
30-
description=settings.APP_DESCRIPTION,
31-
contact=settings.CONTACT,
32-
license_info=settings.CONTACT
33-
)
28+
if isinstance(settings, AppSettings):
29+
application = FastAPI(
30+
title=settings.APP_NAME,
31+
description=settings.APP_DESCRIPTION,
32+
contact=settings.CONTACT,
33+
license_info=settings.CONTACT
34+
)
35+
else:
36+
application = FastAPI()
3437

3538
application.include_router(router)
3639

0 commit comments

Comments
 (0)