From 817ac0e01945f185889680bbe8b753b591cae8ce Mon Sep 17 00:00:00 2001 From: Adam Kirchberger Date: Sat, 26 Aug 2023 09:11:16 +0100 Subject: [PATCH] fix: check delay typo --- README.md | 2 +- fastapi_health_monitor/manager.py | 2 +- fastapi_health_monitor/settings.py | 2 +- tests/test_components.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 03e0cb7..45f0bb8 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ pip install fastapi-health-monitor This example shows a FastAPI application which returns a dad joke from an external API. -The checks are run every 10 seconds by default. This can be changed using an environment variable `HEATH_CHECK_DELAY_SECONDS`. +The checks are run every 10 seconds by default. This can be changed using an environment variable `HEALTH_CHECK_DELAY_SECONDS`. ```python from fastapi import FastAPI diff --git a/fastapi_health_monitor/manager.py b/fastapi_health_monitor/manager.py index 6c26b27..9bf72a4 100644 --- a/fastapi_health_monitor/manager.py +++ b/fastapi_health_monitor/manager.py @@ -75,7 +75,7 @@ async def _run(self) -> None: except Exception as e: # pylint: disable=W0718 logger.exception("manager loop error: " + str(e)) # Wait for health check delay - await asyncio.sleep(settings.heath_check_delay_seconds) + await asyncio.sleep(settings.health_check_delay_seconds) logger.info("stopped health check refresh") def get_response(self) -> SystemHealth: diff --git a/fastapi_health_monitor/settings.py b/fastapi_health_monitor/settings.py index 2af4ef7..1c48fbe 100644 --- a/fastapi_health_monitor/settings.py +++ b/fastapi_health_monitor/settings.py @@ -6,7 +6,7 @@ class Settings(BaseSettings): Settings defines parameters that can be overridden and their defaults. """ - heath_check_delay_seconds: int = 10 + health_check_delay_seconds: int = 10 # Read settings from .env file if one exists model_config = SettingsConfigDict( diff --git a/tests/test_components.py b/tests/test_components.py index 1ba9f13..26a28bb 100644 --- a/tests/test_components.py +++ b/tests/test_components.py @@ -12,7 +12,7 @@ def test_that_health_monitor_component_is_registered(component_status): app = FastAPI(debug=True) # GIVEN health check interval - settings.heath_check_delay_seconds = 1 + settings.health_check_delay_seconds = 1 # GIVEN component check function def fake_component_check(component): @@ -60,7 +60,7 @@ def test_that_health_monitor_unhealthy_component_returns_error_status(component_ app = FastAPI(debug=True) # GIVEN health check interval - settings.heath_check_delay_seconds = 1 + settings.health_check_delay_seconds = 1 # GIVEN component check function def fake_component_check(component): @@ -105,7 +105,7 @@ def test_that_health_monitor_component_error_returns_error_status(caplog): app = FastAPI(debug=True) # GIVEN health check interval - settings.heath_check_delay_seconds = 1 + settings.health_check_delay_seconds = 1 # GIVEN component check function that raises error def fake_component_check(component):