コード例 #1
0
ファイル: __init__.py プロジェクト: lgqlee/blog
 def mongo_client(self):
     return db.get("mongo")
コード例 #2
0
ファイル: __init__.py プロジェクト: lgqlee/blog
 def redis_client(self):
     """
     使用 connection_pool 的时候, redis 将在执行一次操作后回收该连接
     所以每次都要生成新的 connection
     """
     return db.get("redis")