mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -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:
parent
4efbd45b3c
commit
b86d365dde
@ -77,7 +77,7 @@ def events_slicing(key, since, until, last_gather):
|
||||
lower = since or last_gather
|
||||
if not since and last_entries.get(key):
|
||||
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
|
||||
if not since and last_entries.get(key):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user