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

@@ -105,8 +105,11 @@ AWX_CALLBACK_PROFILE = True
AWX_DISABLE_TASK_MANAGERS = False
# ======================!!!!!!! FOR DEVELOPMENT ONLY !!!!!!!=================================
if 'sqlite3' not in DATABASES['default']['ENGINE']: # noqa
DATABASES['default'].setdefault('OPTIONS', dict()).setdefault('application_name', f'{CLUSTER_HOST_ID}-{os.getpid()}-{" ".join(sys.argv)}'[:63]) # noqa
from .application_name import set_application_name
set_application_name(DATABASES, CLUSTER_HOST_ID)
del set_application_name
# If any local_*.py files are present in awx/settings/, use them to override
# default settings for development. If not present, we can still run using