cache.py 文件源码

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

项目:PowerSpikeGG 作者: PowerSpikeGG 项目源码 文件源码
def __init__(self, lazy_connection=False):
        """Constructor. Initialize the client.

        Parameters:
            lazy_connection: avoid testing if the connection is working while
                initializing it.
        """
        if self.address is None:
            self.address = "mongodb://%s/" % FLAGS.rawdata_cache_server_address

        for _ in range(FLAGS.mongodb_connection_retry):
            self.client = self._connect(self.address, lazy_connection)
            if self.client is not None:
                break
        else:
            logging.critical("Unable to reach the MongoDB server.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号