mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Purge event res dict if it is over a certain size
Also purge/update some old settings values
This commit is contained in:
parent
b85c98afd2
commit
a61e729ebb
@ -173,7 +173,9 @@ class EventContext(object):
|
|||||||
if event_data.get(key, False):
|
if event_data.get(key, False):
|
||||||
event = key
|
event = key
|
||||||
break
|
break
|
||||||
|
max_res = int(os.getenv("MAX_EVENT_RES", 700000))
|
||||||
|
if event not in ('playbook_on_stats',) and "res" in event_data and len(str(event_data['res'])) > max_res:
|
||||||
|
event_data['res'] = {}
|
||||||
event_dict = dict(event=event, event_data=event_data)
|
event_dict = dict(event=event, event_data=event_data)
|
||||||
for key in event_data.keys():
|
for key in event_data.keys():
|
||||||
if key in ('job_id', 'ad_hoc_command_id', 'uuid', 'parent_uuid', 'created', 'artifact_data'):
|
if key in ('job_id', 'ad_hoc_command_id', 'uuid', 'parent_uuid', 'created', 'artifact_data'):
|
||||||
|
@ -809,6 +809,7 @@ class RunJob(BaseTask):
|
|||||||
env['REST_API_URL'] = settings.INTERNAL_API_URL
|
env['REST_API_URL'] = settings.INTERNAL_API_URL
|
||||||
env['REST_API_TOKEN'] = job.task_auth_token or ''
|
env['REST_API_TOKEN'] = job.task_auth_token or ''
|
||||||
env['TOWER_HOST'] = settings.TOWER_URL_BASE
|
env['TOWER_HOST'] = settings.TOWER_URL_BASE
|
||||||
|
env['MAX_EVENT_RES'] = settings.MAX_EVENT_RES_DATA
|
||||||
env['CALLBACK_QUEUE'] = settings.CALLBACK_QUEUE
|
env['CALLBACK_QUEUE'] = settings.CALLBACK_QUEUE
|
||||||
env['CALLBACK_CONNECTION'] = settings.BROKER_URL
|
env['CALLBACK_CONNECTION'] = settings.BROKER_URL
|
||||||
if getattr(settings, 'JOB_CALLBACK_DEBUG', False):
|
if getattr(settings, 'JOB_CALLBACK_DEBUG', False):
|
||||||
|
@ -150,7 +150,11 @@ ALLOWED_HOSTS = []
|
|||||||
REMOTE_HOST_HEADERS = ['REMOTE_ADDR', 'REMOTE_HOST']
|
REMOTE_HOST_HEADERS = ['REMOTE_ADDR', 'REMOTE_HOST']
|
||||||
|
|
||||||
# Note: This setting may be overridden by database settings.
|
# Note: This setting may be overridden by database settings.
|
||||||
STDOUT_MAX_BYTES_DISPLAY = 1048576
|
STDOUT_MAX_BYTES_DISPLAY = 10485760
|
||||||
|
|
||||||
|
# The maximum size of the ansible callback event's res data structure
|
||||||
|
# beyond this limit and the value will be removed
|
||||||
|
MAX_EVENT_RES_DATA = 700000
|
||||||
|
|
||||||
# Note: This setting may be overridden by database settings.
|
# Note: This setting may be overridden by database settings.
|
||||||
EVENT_STDOUT_MAX_BYTES_DISPLAY = 1024
|
EVENT_STDOUT_MAX_BYTES_DISPLAY = 1024
|
||||||
@ -522,17 +526,6 @@ ANSIBLE_FORCE_COLOR = True
|
|||||||
# the celery task.
|
# the celery task.
|
||||||
AWX_TASK_ENV = {}
|
AWX_TASK_ENV = {}
|
||||||
|
|
||||||
# Maximum number of job events processed by the callback receiver worker process
|
|
||||||
# before it recycles
|
|
||||||
JOB_EVENT_RECYCLE_THRESHOLD = 3000
|
|
||||||
|
|
||||||
# Number of workers used to proecess job events in parallel
|
|
||||||
JOB_EVENT_WORKERS = 4
|
|
||||||
|
|
||||||
# Maximum number of job events that can be waiting on a single worker queue before
|
|
||||||
# it can be skipped as too busy
|
|
||||||
JOB_EVENT_MAX_QUEUE_SIZE = 100
|
|
||||||
|
|
||||||
# Flag to enable/disable updating hosts M2M when saving job events.
|
# Flag to enable/disable updating hosts M2M when saving job events.
|
||||||
CAPTURE_JOB_EVENT_HOSTS = False
|
CAPTURE_JOB_EVENT_HOSTS = False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user