Skip to content

Commit ade2036

Browse files
committed
Add batch commit and push every 1000 files
Signed-off-by: ziad hany <[email protected]>
1 parent 0f629e4 commit ade2036

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

minecode_pipelines/pipes/cran.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,21 @@
2828

2929

3030
def mine_and_publish_cran_packageurls(fed_repo, db_path):
31+
batch_counter = 0
3132
for purls in extract_cran_packages(db_path):
33+
batch_counter += 1
3234
if not purls:
3335
continue
3436

3537
first_purl = purls[0]
3638
purl_yaml_path = get_package_purls_yml_file_path(first_purl)
3739
git_stage_purls(purls, fed_repo, purl_yaml_path)
3840

39-
commit_and_push_changes(fed_repo)
41+
if batch_counter > 1000:
42+
commit_and_push_changes(fed_repo)
43+
batch_counter = 0
4044

45+
commit_and_push_changes(fed_repo)
4146

4247
def extract_cran_packages(json_file_path: str) -> list:
4348
"""

0 commit comments

Comments
 (0)