Skip to content

Commit

Permalink
fix queue names
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Jul 13, 2023
1 parent 5abbcf4 commit db481bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion renku/ui/service/cache/config.py
Expand Up @@ -17,13 +17,21 @@
"""Renku service cache configuration."""
import os
import platform
import socket
import uuid

container_name = platform.node()
if not container_name:
container_name = socket.gethostname()
if not container_name:
container_name = uuid.uuid4().hex # NOTE: Fallback if no hostname could be determined

REDIS_HOST = os.getenv("REDIS_HOST", "localhost")
REDIS_PORT = int(os.getenv("REDIS_PORT", 6379))
REDIS_DATABASE = int(os.getenv("REDIS_DATABASE", 0))
REDIS_PASSWORD = os.getenv("REDIS_PASSWORD")

REDIS_NAMESPACE = os.getenv("REDIS_NAMESPACE", "") + platform.node()
REDIS_NAMESPACE = os.getenv("REDIS_NAMESPACE", "") + container_name

REDIS_IS_SENTINEL = os.environ.get("REDIS_IS_SENTINEL", "") == "true"
REDIS_MASTER_SET = os.environ.get("REDIS_MASTER_SET", "mymaster")
6 changes: 3 additions & 3 deletions renku/ui/service/worker.py
Expand Up @@ -67,9 +67,9 @@ def start_worker(queue_list):
q = [f"{REDIS_NAMESPACE}.{q.strip()}" for q in queue_list if q.strip()]
check_queues(q)

worker_log.info(f"working on queues: {queue_list}")
worker_log.info(f"working on queues: {q}")

with worker(queue_list) as rq_worker:
with worker(q) as rq_worker:
worker_log.info("running worker")
rq_worker.work(logging_level=DEPLOYMENT_LOG_LEVEL)

Expand All @@ -83,4 +83,4 @@ def start_worker(queue_list):
"Worker queues not specified. Please, set RENKU_SVC_WORKER_QUEUES environment variable."
)

start_worker([queue_name.strip() for queue_name in queues.strip().split(",")])
start_worker([f"{REDIS_NAMESPACE}.{queue_name.strip()}" for queue_name in queues.strip().split(",")])

0 comments on commit db481bb

Please sign in to comment.