mirror of
https://github.com/ansible/awx.git
synced 2026-02-12 15:14:45 -03:30
collect job events based on job event modified time
* when collecting job events by creation time it is possible to miss events that were created at one point, but actually committed to the db much later. * since events' modified time is set when they are committed to the db, we shouldn't miss any job events * selecting job events by modified time wasn't possible beforehand because we didn't have an index for jobevent's modified field
This commit is contained in:
@@ -77,7 +77,7 @@ def events_slicing(key, since, until, last_gather):
|
|||||||
lower = since or last_gather
|
lower = since or last_gather
|
||||||
if not since and last_entries.get(key):
|
if not since and last_entries.get(key):
|
||||||
lower = horizon
|
lower = horizon
|
||||||
pk_values = models.JobEvent.objects.filter(created__gte=lower, created__lte=until).aggregate(Min('pk'), Max('pk'))
|
pk_values = models.JobEvent.objects.filter(modified__gte=lower, modified__lte=until).aggregate(Min('pk'), Max('pk'))
|
||||||
|
|
||||||
previous_pk = pk_values['pk__min'] - 1 if pk_values['pk__min'] is not None else 0
|
previous_pk = pk_values['pk__min'] - 1 if pk_values['pk__min'] is not None else 0
|
||||||
if not since and last_entries.get(key):
|
if not since and last_entries.get(key):
|
||||||
|
|||||||
Reference in New Issue
Block a user