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
This commit is contained in:
David Arnold 2023-07-02 11:16:53 -05:00 committed by GitHub
parent 721035b313
commit f5b93cc2a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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