redis_cluster.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:tasker 作者: wavenator 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号