ЛР 2: PostgreSQL, сессии Basic/Bearer, Redis-кэш, тесты и отчёт
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
Точка входа контейнера: `python -m app`. Настройки — из окружения (app/config.py).
|
||||
uvicorn ловит SIGTERM: перестаёт принимать запросы и дожидается текущих
|
||||
(до SHUTDOWN_TIMEOUT), затем закрывает пул БД и соединение с Redis.
|
||||
"""
|
||||
import logging
|
||||
|
||||
import uvicorn
|
||||
|
||||
from .config import settings
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=settings.log_level.upper(),
|
||||
format="%(asctime)s %(levelname)s %(name)s %(message)s")
|
||||
uvicorn.run(
|
||||
"app.main:app",
|
||||
host=settings.host,
|
||||
port=settings.port,
|
||||
timeout_graceful_shutdown=settings.shutdown_timeout,
|
||||
access_log=False, # свой лог в middleware: без query, токенов и тел
|
||||
log_level=settings.log_level,
|
||||
)
|
||||
Reference in New Issue
Block a user