xbackend/db/ckdb_utils.py
2021-09-28 11:17:08 +08:00

16 lines
339 B
Python

from aioch import Client
from core.config import settings
from .ckdb import CKDrive
async def connect_to_ck(pool_size=15):
for i in range(pool_size):
client = Client(**settings.CK_CONFIG)
CKDrive.ClientPool.add(client)
async def close_ck_connection():
for c in CKDrive.ClientPool:
await c.disconnect()