From 59b89aaa5cb6762aee349ccb7d1d271a4ed396c7 Mon Sep 17 00:00:00 2001 From: blackholll Date: Tue, 18 Oct 2022 22:55:00 +0800 Subject: [PATCH] optimize: support redis server use no password --- service/redis_pool.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/service/redis_pool.py b/service/redis_pool.py index 0e586709..e551075e 100644 --- a/service/redis_pool.py +++ b/service/redis_pool.py @@ -6,6 +6,8 @@ redis_db = settings.REDIS_DB redis_port = settings.REDIS_PORT redis_password = settings.REDIS_PASSWORD - -POOL = redis.ConnectionPool(host=redis_host, port=redis_port, password=redis_password, max_connections=1000) +if redis_password: + POOL = redis.ConnectionPool(host=redis_host, port=redis_port, password=redis_password, max_connections=1000) +else: + POOL = redis.ConnectionPool(host=redis_host, port=redis_port, max_connections=1000)