Skip to content

Commit 7023289

Browse files
authored
Merge pull request #1621 from aldo-o/ignore-redis-prepend
feat: Ignore `redis` if present.
2 parents 03f1af1 + 290e355 commit 7023289

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

bench/utils/bench.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,15 +564,24 @@ def set_mariadb_host(host, bench_path="."):
564564

565565

566566
def set_redis_cache_host(host, bench_path="."):
567-
update_common_site_config({"redis_cache": f"redis://{host}"}, bench_path=bench_path)
567+
if isinstance(host, str) and not host.lower().startswith("redis"):
568+
host = f"redis://{host}"
569+
570+
update_common_site_config({"redis_cache": host}, bench_path=bench_path)
568571

569572

570573
def set_redis_queue_host(host, bench_path="."):
571-
update_common_site_config({"redis_queue": f"redis://{host}"}, bench_path=bench_path)
574+
if isinstance(host, str) and not host.lower().startswith("redis"):
575+
host = f"redis://{host}"
576+
577+
update_common_site_config({"redis_queue": host}, bench_path=bench_path)
572578

573579

574580
def set_redis_socketio_host(host, bench_path="."):
575-
update_common_site_config({"redis_socketio": f"redis://{host}"}, bench_path=bench_path)
581+
if isinstance(host, str) and not host.lower().startswith("redis"):
582+
host = f"redis://{host}"
583+
584+
update_common_site_config({"redis_socketio": host}, bench_path=bench_path)
576585

577586

578587
def update_common_site_config(ddict, bench_path="."):

0 commit comments

Comments
 (0)