2021-05-05 03:41:27 +00:00
|
|
|
import redis
|
2021-06-20 11:07:26 +00:00
|
|
|
from config import REDIS_CONFIG
|
2021-05-05 03:41:27 +00:00
|
|
|
|
2021-06-20 11:07:26 +00:00
|
|
|
pool = redis.ConnectionPool(host=REDIS_CONFIG['host'], port=REDIS_CONFIG['port'], db=REDIS_CONFIG['db'],
|
|
|
|
encoding='utf8', decode_responses=True)
|
2021-05-05 03:41:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
def get_connection():
|
|
|
|
return redis.StrictRedis(connection_pool=pool)
|