diff --git a/backend/utils/cache.py b/backend/utils/cache.py index 60c80519d..23a9e0428 100644 --- a/backend/utils/cache.py +++ b/backend/utils/cache.py @@ -2,15 +2,6 @@ from redis import Redis from config import REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, ENABLE_EXPERIMENTAL_REDIS -redis_client = Redis( - host=REDIS_HOST, port=int(REDIS_PORT), password=REDIS_PASSWORD, db=0 -) -redis_url = ( - f"redis://:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}" - if REDIS_PASSWORD - else f"redis://{REDIS_HOST}:{REDIS_PORT}" -) - class FallbackCache: def __init__(self) -> None: diff --git a/backend/utils/redis.py b/backend/utils/redis.py index 436dd240b..c6e13d950 100644 --- a/backend/utils/redis.py +++ b/backend/utils/redis.py @@ -1,11 +1,18 @@ from redis import Redis from rq import Queue -from config import REDIS_HOST, REDIS_PORT +from config import REDIS_HOST, REDIS_PORT, REDIS_PASSWORD -redis_client = Redis(host=REDIS_HOST, port=int(REDIS_PORT), db=0) -redis_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/0" +redis_client = Redis( + host=REDIS_HOST, port=int(REDIS_PORT), password=REDIS_PASSWORD, db=0 +) +redis_url = ( + f"redis://:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}" + if REDIS_PASSWORD + else f"redis://{REDIS_HOST}:{REDIS_PORT}" +) + high_prio_queue = Queue(name="high", connection=redis_client) default_queue = Queue(name="default", connection=redis_client)