From f5b93cc2a02a9298b7e025a8a107bd204609d95d Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sun, 2 Jul 2023 11:16:53 -0500 Subject: [PATCH] chore: urlparse already does the parsing for us, no need to diy (#21558) This is a very minor cleanup. So minor, that it hopefully is a nobrainer --- frappe/utils/connections.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frappe/utils/connections.py b/frappe/utils/connections.py index 020bc8b97f41..fcca8593ad86 100644 --- a/frappe/utils/connections.py +++ b/frappe/utils/connections.py @@ -31,10 +31,9 @@ def check_redis(redis_services=None): config = get_conf() services = redis_services or REDIS_KEYS status = {} - for conn in services: - redis_url = urlparse(config.get(conn)).netloc - redis_host, redis_port = redis_url.split(":") - status[conn] = is_open(redis_host, redis_port) + for srv in services: + url = urlparse(config[srv]) + status[srv] = is_open(url.hostname, url.port) return status