LISTENER_DATABASES clobbers DATABASES OPTIONS (#15306)

Do not overwrite DATABASES OPTIONS with LISTENER_DATABASES
This commit is contained in:
jamesmarshall24
2024-06-27 13:26:30 -04:00
committed by GitHub
parent 6f2307f50e
commit 4e0d19914f
2 changed files with 4 additions and 2 deletions

View File

@@ -102,6 +102,7 @@ def create_listener_connection():
# Apply overrides specifically for the listener connection
for k, v in settings.LISTENER_DATABASES.get('default', {}).items():
if k != 'OPTIONS':
conf[k] = v
for k, v in settings.LISTENER_DATABASES.get('default', {}).get('OPTIONS', {}).items():
conf['OPTIONS'][k] = v

View File

@@ -306,6 +306,7 @@ class WebSocketRelayManager(object):
database_conf['OPTIONS'] = deepcopy(database_conf.get('OPTIONS', {}))
for k, v in settings.LISTENER_DATABASES.get('default', {}).items():
if k != 'OPTIONS':
database_conf[k] = v
for k, v in settings.LISTENER_DATABASES.get('default', {}).get('OPTIONS', {}).items():
database_conf['OPTIONS'][k] = v