Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 disable health check for Redis client #5946

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions packages/service-library/src/servicelib/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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",
Expand Down
Loading