From b932e14897944b5a64e76d158c3ab1939ca40a58 Mon Sep 17 00:00:00 2001 From: Chenqi Shan Date: Sun, 29 May 2022 16:00:11 +0800 Subject: [PATCH] reset the counter after processed commits in branch. Signed-off-by: Chenqi Shan --- grimoire_elk/enriched/git.py | 4 +++- .../counter-reset-after-processed-commits-in-branch.yml | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releases/unreleased/counter-reset-after-processed-commits-in-branch.yml 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:".