Customize application_name for different connections in dispatcher service (#13074)

* Introduce new method in settings, import in-line w NOQA mark

* Further refine the app_name to use shorter service names like dispatcher

* Clean up listener logic, change some names
This commit is contained in:
Alan Rominger
2023-04-13 22:36:36 -04:00
committed by GitHub
parent 2205664fb4
commit 342e9197b8
7 changed files with 61 additions and 9 deletions

View File

@@ -3,6 +3,9 @@
from itertools import chain
from awx.settings.application_name import set_application_name
from django.conf import settings
def get_all_field_names(model):
# Implements compatibility with _meta.get_all_field_names
@@ -18,3 +21,7 @@ def get_all_field_names(model):
)
)
)
def set_connection_name(function):
set_application_name(settings.DATABASES, settings.CLUSTER_HOST_ID, function=function)