mirror of
https://github.com/ijaric/voice_assistant.git
synced 2025-12-15 21:06:17 +00:00
Архитектурные правки
This commit is contained in:
@@ -25,7 +25,7 @@ async def main():
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Exited with keyboard interruption")
|
||||
except Exception as e:
|
||||
logger.exception("Unexpected error occurred")
|
||||
logger.exception(f"Unexpected error occurred: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
1
src/fastapi_app/lib/api/v1/dependencies/__init__.py
Normal file
1
src/fastapi_app/lib/api/v1/dependencies/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .token import *
|
||||
@@ -2,7 +2,7 @@ import fastapi
|
||||
from jose import JWTError, jwt
|
||||
from pydantic import ValidationError
|
||||
|
||||
import lib.api.v1.schemas as app_schemas
|
||||
import lib.api.schemas as app_schemas
|
||||
import lib.app.settings as app_settings
|
||||
|
||||
settings = app_settings.get_settings()
|
||||
@@ -3,7 +3,7 @@ import logging.config as logging_config
|
||||
|
||||
import fastapi
|
||||
|
||||
import lib.api.v1.handlers as api_v1_handlers
|
||||
import lib.api.v1.endpoints as api_v1_endpoints
|
||||
|
||||
from .logger import LOGGING
|
||||
from .settings import get_settings
|
||||
@@ -43,8 +43,9 @@ class Application:
|
||||
|
||||
# Handlers
|
||||
|
||||
app.include_router(api_v1_endpoints.health.health_router, prefix="/api/v1/health", tags=["health"])
|
||||
|
||||
logger.info("Initializing handlers")
|
||||
app.include_router(api_v1_handlers.health.health_router, prefix="/api/v1/health", tags=["health"])
|
||||
|
||||
logger.info("Initializing application finished")
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ LOGGING = {
|
||||
"fmt": "%(levelprefix)s %(client_addr)s - '%(request_line)s' %(status_code)s",
|
||||
},
|
||||
},
|
||||
"handlers": {
|
||||
"endpoints": {
|
||||
"console": {
|
||||
"level": log_settings.log_level_handlers,
|
||||
"class": "logging.StreamHandler",
|
||||
@@ -49,14 +49,14 @@ LOGGING = {
|
||||
},
|
||||
"loggers": {
|
||||
"": {
|
||||
"handlers": log_settings.log_default_handlers,
|
||||
"endpoints": log_settings.log_default_handlers,
|
||||
"level": log_settings.log_level_loggers,
|
||||
},
|
||||
"uvicorn.error": {
|
||||
"level": log_settings.log_level_loggers,
|
||||
},
|
||||
"uvicorn.access": {
|
||||
"handlers": ["access"],
|
||||
"endpoints": ["access"],
|
||||
"level": log_settings.log_level_loggers,
|
||||
"propagate": False,
|
||||
},
|
||||
@@ -64,6 +64,6 @@ LOGGING = {
|
||||
"root": {
|
||||
"level": log_settings.log_level_root,
|
||||
"formatter": "verbose",
|
||||
"handlers": log_settings.log_default_handlers,
|
||||
"endpoints": log_settings.log_default_handlers,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class Application:
|
||||
|
||||
# Handlers
|
||||
|
||||
logger.info("Initializing handlers")
|
||||
logger.info("Initializing endpoints")
|
||||
liveness_probe_handler = health_handlers.LivenessProbeHandler()
|
||||
|
||||
logger.info("Creating application")
|
||||
|
||||
Reference in New Issue
Block a user