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:
parent
721035b313
commit
f5b93cc2a0
1 changed files with 3 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue