def get_mongodb_connection(cls):
if cls._connection is not None:
return cls._connection
try:
cls._connection = pymongo.Connection(
"{0}:{1}".format(
REQUEST_LOGGING_BACKEND['host'],
REQUEST_LOGGING_BACKEND['port']
)
)
return cls._connection
except Exception as e:
# TODO: Add log here.
return None
评论列表
文章目录