Skip to content

Commit

Permalink
chore: urlparse already does the parsing for us, no need to diy (frap…
Browse files Browse the repository at this point in the history
…pe#21558)

This is a very minor cleanup. So minor, that it hopefully is a nobrainer
  • Loading branch information
blaggacao committed Jul 2, 2023
1 parent 721035b commit f5b93cc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions frappe/utils/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit f5b93cc

Please sign in to comment.