mirror of
https://github.com/ansible/awx.git
synced 2026-06-30 02:48:03 -02: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:
@@ -5,6 +5,7 @@ import json
|
||||
from uuid import uuid4
|
||||
|
||||
from django.conf import settings
|
||||
from django_guid.middleware import GuidMiddleware
|
||||
|
||||
from . import pg_bus_conn
|
||||
|
||||
@@ -83,6 +84,9 @@ class task:
|
||||
'kwargs': kwargs,
|
||||
'task': cls.name
|
||||
}
|
||||
guid = GuidMiddleware.get_guid()
|
||||
if guid:
|
||||
obj['guid'] = guid
|
||||
obj.update(**kw)
|
||||
if callable(queue):
|
||||
queue = queue()
|
||||
|
||||
Reference in New Issue
Block a user