xbackend/db/ckdb_utils.py
2021-07-27 16:08:49 +08:00

16 lines
340 B
Python

from aioch import Client
from core.config import settings
from .ckdb import CKDrive
async def connect_to_ck(pool_size=100):
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()