sentinel.py 文件源码

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

项目:asgi_redis 作者: django 项目源码 文件源码
def _setup_hosts(self, hosts):
        # Override to only accept tuples, since the redis.sentinel.Sentinel does not accept URLs
        if not hosts:
            hosts = [("localhost", 26379)]
        final_hosts = list()
        if isinstance(hosts, six.string_types):
            # user accidentally used one host string instead of providing a list of hosts
            raise ValueError("ASGI Redis hosts must be specified as an iterable list of hosts.")

        for entry in hosts:
            if isinstance(entry, six.string_types):
                raise ValueError("Sentinel Redis host entries must be specified as tuples, not strings.")
            else:
                final_hosts.append(entry)
        return final_hosts
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号