diff --git a/grimoire_elk/enriched/git.py b/grimoire_elk/enriched/git.py index be71f2a0f..95c92807b 100644 --- a/grimoire_elk/enriched/git.py +++ b/grimoire_elk/enriched/git.py @@ -1036,7 +1036,9 @@ def add_commit_branches(self, git_repo, enrich_backend): if commit_count: self.__process_commits_in_branch(enrich_backend, git_repo.uri, branch_name, to_process) - + # reset the counter + to_process = [] + commit_count = 0 except Exception as e: logger.error("[git] Skip adding branch info for repo {} due to {}".format(git_repo.uri, e)) return diff --git a/releases/unreleased/counter-reset-after-processed-commits-in-branch.yml b/releases/unreleased/counter-reset-after-processed-commits-in-branch.yml new file mode 100644 index 000000000..fe6c26e2a --- /dev/null +++ b/releases/unreleased/counter-reset-after-processed-commits-in-branch.yml @@ -0,0 +1,6 @@ +title: 'reset the counter after processed commits in branch ' +category: fixed +author: ChenqiShan +issue: +notes: > + During the study enrich_git_branches, we reset the counter only after if commit_count == MAX_BULK_UPDATE_SIZE:.We should also reset the counter after if commit_count: by the same way.Otherwise, to_process list will be added to next for Loop when branched has been added by "if commit_count:".