Fix batch events counting

This commit is contained in:
allegroai 2021-01-05 17:37:40 +02:00
parent 018582ff8a
commit eb4c9f0b13

View File

@ -206,7 +206,7 @@ class EventBLL(object):
) as it:
for success, info in it:
if success:
added += chunk_size
added += 1
else:
errors_per_type["Error when indexing events batch"] += 1
@ -233,9 +233,6 @@ class EventBLL(object):
remaining_tasks, company_id, last_update=now
)
# Compensate for always adding chunk_size on success (last chunk is probably smaller)
added = min(added, len(actions))
if not added:
raise errors.bad_request.EventsNotAdded(**errors_per_type)