cache.py 文件源码

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

项目:harbour-sailfinder 作者: DylanVanAssche 项目源码 文件源码
def __init__(self, host='localhost', port=6379, password=None,
                 db=0, default_timeout=300, key_prefix=None, **kwargs):
        BaseCache.__init__(self, default_timeout)
        if isinstance(host, string_types):
            try:
                import redis
            except ImportError:
                raise RuntimeError('no redis module found')
            if kwargs.get('decode_responses', None):
                raise ValueError('decode_responses is not supported by '
                                 'RedisCache.')
            self._client = redis.Redis(host=host, port=port, password=password,
                                       db=db, **kwargs)
        else:
            self._client = host
        self.key_prefix = key_prefix or ''
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号