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)
db_manager.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录