Skip to content

Commit

Permalink
fix: check delay typo
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkirchberger committed Aug 26, 2023
1 parent e9913b7 commit 817ac0e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fastapi_health_monitor/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion fastapi_health_monitor/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 817ac0e

Please sign in to comment.