Merge pull request #12726 from zerodha/check_connections

fix: global get_conf() fails to return site config
This commit is contained in:
mergify[bot] 2021-03-30 15:11:45 +00:00 committed by GitHub
commit a1f15245f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,6 @@ import socket
from six.moves.urllib.parse import urlparse
from frappe import get_conf
config = get_conf()
REDIS_KEYS = ('redis_cache', 'redis_queue', 'redis_socketio')
@ -21,6 +20,7 @@ def is_open(ip, port, timeout=10):
def check_database():
config = get_conf()
db_type = config.get("db_type", "mariadb")
db_host = config.get("db_host", "localhost")
db_port = config.get("db_port", 3306 if db_type == "mariadb" else 5432)
@ -28,6 +28,7 @@ def check_database():
def check_redis(redis_services=None):
config = get_conf()
services = redis_services or REDIS_KEYS
status = {}
for conn in services: