db_manager.py 文件源码

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

项目:MgmtAppForLinuxMachines_flask 作者: yugokato 项目源码 文件源码
def __connect_db(self):
        try:
            app.logger.info(("Checking the connectivity to the database(%s)...." % self.__database_ip))
            db =  connect(self.__database_name, host=self.__database_ip, port=self.__port, serverSelectionTimeoutMS=3000)
            db.server_info()
            app.logger.info("...OK")
            return db
        except Exception as e:
            app.logger.error("Unable to connect to %s" % self.__database_ip)
            sys.exit(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号