File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,9 @@ async def health_check():
5050 last_successful_update = None ,
5151 )
5252
53- if settings .health_check .count_stale_documents_as_failing :
54- buffer = settings .health_check .grace_period_seconds * len (
55- settings .environment_key_pairs
56- )
53+ grace_period = settings .health_check .environment_update_grace_period_seconds
54+ if grace_period is not None :
55+ buffer = grace_period * len (settings .environment_key_pairs )
5756 threshold = datetime .now () - timedelta (
5857 seconds = settings .api_poll_frequency_seconds + buffer
5958 )
Original file line number Diff line number Diff line change 44import sys
55from enum import Enum
66from pathlib import Path
7- from typing import Any
7+ from typing import Any , Optional
88
99import structlog
1010
@@ -101,8 +101,7 @@ class ServerSettings(BaseModel):
101101
102102
103103class HealthCheckSettings (BaseModel ):
104- count_stale_documents_as_failing : bool = True
105- grace_period_seconds : int = 30
104+ environment_update_grace_period_seconds : Optional [int ] = 30
106105
107106
108107class AppSettings (BaseModel ):
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ def test_health_check_returns_200_if_cache_is_stale_and_health_check_configured_
6060) -> None :
6161 # Given
6262 settings = AppSettings (
63- health_check = HealthCheckSettings (count_stale_documents_as_failing = False )
63+ health_check = HealthCheckSettings (environment_update_grace_period_seconds = None )
6464 )
6565 mocker .patch ("edge_proxy.server.settings" , settings )
6666
You can’t perform that action at this time.
0 commit comments