From 1ee23859447834f166bc4dbdd05cbd2e7c8e510a Mon Sep 17 00:00:00 2001 From: lukptr <17918335+lukptr@users.noreply.github.com> Date: Thu, 9 Sep 2021 16:19:19 +0700 Subject: [PATCH] feat: custom database port for read-only replica configuration --- frappe/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index ff08924e72..64e445973f 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -235,14 +235,11 @@ def connect_replica(): from frappe.database import get_db user = local.conf.db_name password = local.conf.db_password - port = None + port = local.conf.replica_db_port if local.conf.different_credentials_for_replica: user = local.conf.replica_db_name password = local.conf.replica_db_password - - if local.conf.replica_db_port: - port = local.conf.replica_db_port local.replica_db = get_db(host=local.conf.replica_host, user=user, password=password, port=port)