From 7b2d66ab1af6fc7c7ff02983119d66a5ccbd52a3 Mon Sep 17 00:00:00 2001 From: Andrei Neagu <5694077+GitHK@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:21:56 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20disable=20health=20check=20for?= =?UTF-8?q?=20Redis=20client=20(#5946)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrei Neagu --- .../service-library/src/servicelib/redis.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/service-library/src/servicelib/redis.py b/packages/service-library/src/servicelib/redis.py index d90f124be97..83e29d0b4f2 100644 --- a/packages/service-library/src/servicelib/redis.py +++ b/packages/service-library/src/servicelib/redis.py @@ -17,7 +17,7 @@ from settings_library.redis import RedisDatabase, RedisSettings from tenacity import retry -from .background_task import periodic_task, start_periodic_task, stop_periodic_task +from .background_task import periodic_task, stop_periodic_task from .logging_utils import log_catch, log_context from .retry_policies import RedisRetryPolicyUponInitialization @@ -54,7 +54,9 @@ class RedisClientSDK: _client: aioredis.Redis = field(init=False) _health_check_task: Task | None = None - _is_healthy: bool = False + _is_healthy: bool = ( + True # revert back to False when stop_periodic_task issue is fixed + ) @property def redis(self) -> aioredis.Redis: @@ -83,11 +85,12 @@ async def setup(self) -> None: raise CouldNotConnectToRedisError(dsn=self.redis_dsn) self._is_healthy = True - self._health_check_task = start_periodic_task( - self._check_health, - interval=self.health_check_interval, - task_name=f"redis_service_health_check_{self.redis_dsn}", - ) + # Disabled till issue with stop_periodic_task is fixed + # self._health_check_task = start_periodic_task( + # self._check_health, + # interval=self.health_check_interval, + # task_name=f"redis_service_health_check_{self.redis_dsn}", + # ) _logger.info( "Connection to %s succeeded with %s",