Switch to new redis version

This commit is contained in:
allegroai 2023-05-25 19:22:39 +03:00
parent 755cc803d9
commit cf8e847ed3

View File

@ -2,7 +2,7 @@ from os import getenv
from boltons.iterutils import first from boltons.iterutils import first
from redis import StrictRedis from redis import StrictRedis
from rediscluster import RedisCluster from redis.cluster import RedisCluster
from apiserver.apierrors.errors.server_error import ConfigError, GeneralError from apiserver.apierrors.errors.server_error import ConfigError, GeneralError
from apiserver.config_repo import config from apiserver.config_repo import config
@ -83,7 +83,7 @@ class RedisManager(object):
def host(self, alias): def host(self, alias):
r = self.connection(alias) r = self.connection(alias)
if isinstance(r, RedisCluster): if isinstance(r, RedisCluster):
connections = first(r.connection_pool._available_connections.values()) connections = r.get_default_node().redis_connection.connection_pool._available_connections
else: else:
connections = r.connection_pool._available_connections connections = r.connection_pool._available_connections