mongo.py 文件源码

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

项目:fastweb 作者: BSlience 项目源码 文件源码
def connect(self):
        """????"""

        try:
            self.recorder('INFO', '{obj} connect start'.format(obj=self))
            self.set_idle()
            self._client = motor_tornado.MotorClient(**self.setting)
            if self.db:
                self.select_db(self.db)
            self.isConnect = True
            self.recorder('INFO', '{obj} connect successful'.format(obj=self))
        except ConnectionFailure as e:
            self.recorder('ERROR', '{obj} connect failed [{msg}]'.format(obj=self, msg=e))
            self.error()
            raise MongoError
        raise Return(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号