Merge pull request #12726 from zerodha/check_connections
fix: global get_conf() fails to return site config
This commit is contained in:
commit
a1f15245f7
1 changed files with 2 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue