-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from Studio-Yandex-Practicum/feature/add_heal…
…thcheck feature/add_healthcheck_bot_checkup
- Loading branch information
Showing
11 changed files
with
233 additions
and
42 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
DATE_FORMAT = "%d-%m-%Y" | ||
DATE_TIME_FORMAT = "%d-%m-%Y %H:%M:%S" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from dependency_injector.wiring import Provide, inject | ||
from fastapi import APIRouter, Depends | ||
|
||
from src.api.schemas import HealthCheck | ||
from src.api.services.health_check import HealthCheckService | ||
from src.core.logging.utils import logger_decor | ||
from src.depends import Container | ||
|
||
health_check_router = APIRouter() | ||
|
||
|
||
@logger_decor | ||
@health_check_router.get("/", description="Проверяет соединение с БД, ботом и выводит информацию о последнем коммите.") | ||
@inject | ||
async def get_health_check( | ||
health_check_service: HealthCheckService = Depends(Provide[Container.health_check_service]), | ||
) -> HealthCheck: | ||
return HealthCheck( | ||
db=await health_check_service.check_db_connection(), | ||
bot=await health_check_service.check_bot(), | ||
git=await health_check_service.get_last_commit(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.