Добавил наблюдаемость

This commit is contained in:
Югай Артур Рустамович
2026-11-24 20:36:06 +03:00
parent 470d9d6f1e
commit 2bab78832a
64 changed files with 9070 additions and 47 deletions
+21
View File
@@ -0,0 +1,21 @@
import logging
import os
import uvicorn
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, format="%(levelname)s %(message)s")
logging.getLogger("messenger").info("environment=%s", os.environ.get("APP_ENV", "lab"))
port = int(os.environ.get("APP_PORT", "8080"))
if not 1 <= port <= 65535:
raise SystemExit("APP_PORT должен быть от 1 до 65535")
uvicorn.run(
"src.app:create_app",
factory=True,
host=os.environ.get("APP_HOST", "0.0.0.0"),
port=port,
workers=1,
access_log=False,
timeout_graceful_shutdown=2,
)