mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 09:48:51 -03:30
add a per-request GUID and log as it travels through background services
see: https://github.com/ansible/awx/issues/9329
This commit is contained in:
@@ -16,6 +16,7 @@ from queue import Full as QueueFull, Empty as QueueEmpty
|
||||
from django.conf import settings
|
||||
from django.db import connection as django_connection, connections
|
||||
from django.core.cache import cache as django_cache
|
||||
from django_guid.middleware import GuidMiddleware
|
||||
from jinja2 import Template
|
||||
import psutil
|
||||
|
||||
@@ -445,6 +446,8 @@ class AutoscalePool(WorkerPool):
|
||||
return super(AutoscalePool, self).up()
|
||||
|
||||
def write(self, preferred_queue, body):
|
||||
if 'guid' in body:
|
||||
GuidMiddleware.set_guid(body['guid'])
|
||||
try:
|
||||
# when the cluster heartbeat occurs, clean up internally
|
||||
if isinstance(body, dict) and 'cluster_node_heartbeat' in body['task']:
|
||||
|
||||
Reference in New Issue
Block a user