word_cloud_bot/connector.py
2021-06-20 16:56:30 +08:00

10 lines
294 B
Python

import redis
from config import REDIS_CONFIG
pool = redis.ConnectionPool(host=REDIS_CONFIG['host'], port=REDIS_CONFIG['port'], db=REDIS_CONFIG['db'],
encoding='utf8', decode_responses=True)
def get_connection():
return redis.StrictRedis(connection_pool=pool)