From eb4c9f0b139fbcd17298f2c9a602b47a02aeea5b Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Tue, 5 Jan 2021 17:37:40 +0200 Subject: [PATCH] Fix batch events counting --- apiserver/bll/event/event_bll.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apiserver/bll/event/event_bll.py b/apiserver/bll/event/event_bll.py index b244c71..f868c33 100644 --- a/apiserver/bll/event/event_bll.py +++ b/apiserver/bll/event/event_bll.py @@ -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)