From b7227113bef986d35dbf6735c583f25916aa94b1 Mon Sep 17 00:00:00 2001 From: Ladislav Smola Date: Thu, 5 Mar 2020 14:52:46 +0100 Subject: [PATCH] Use modified to check if job should be sent to analytics It can take several hours for a job to go from pending to successful/failed state and we need to also send the job with a changed state, otherwise the analytics will be incorrect. --- awx/main/analytics/collectors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/analytics/collectors.py b/awx/main/analytics/collectors.py index 17158d853f..0f15538567 100644 --- a/awx/main/analytics/collectors.py +++ b/awx/main/analytics/collectors.py @@ -277,7 +277,7 @@ def copy_tables(since, full_path): FROM main_unifiedjob JOIN django_content_type ON main_unifiedjob.polymorphic_ctype_id = django_content_type.id JOIN main_organization ON main_organization.id = main_unifiedjob.organization_id - WHERE main_unifiedjob.created > {} + WHERE main_unifiedjob.modified > {} AND main_unifiedjob.launch_type != 'sync' ORDER BY main_unifiedjob.id ASC) TO STDOUT WITH CSV HEADER'''.format(since.strftime("'%Y-%m-%d %H:%M:%S'")) _copy_table(table='unified_jobs', query=unified_job_query, path=full_path)