def setup_rq_connection():
redis_url = current_app.config.get('REDIS_URL')
if redis_url:
current_app.redis_conn = from_url(redis_url)
else:
current_app.redis_conn = Redis(
host=current_app.config.get('REDIS_HOST'),
port=current_app.config.get('REDIS_PORT'),
password=current_app.config.get('REDIS_PASSWORD'),
db=current_app.config.get('REDIS_DB')
)
评论列表
文章目录