def __init__(
self,
nodes,
):
super().__init__()
self.nodes = nodes
self.connections = [
redis.StrictRedis(
host=node['host'],
port=node['port'],
password=node['password'],
db=node['database'],
retry_on_timeout=True,
socket_keepalive=True,
socket_connect_timeout=10,
socket_timeout=60,
)
for node in nodes
]
self.master_connection = self.connections[0]
random.shuffle(self.connections)
评论列表
文章目录