Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit c9ed88b

Browse files
fix: process flakes (#1171)
1 parent 725a8d1 commit c9ed88b

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

services/processing/flake_processing.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@
1919
def process_flake_for_repo_commit(
2020
repo_id: int,
2121
commit_id: str,
22+
):
23+
with django_transaction.atomic():
24+
process_flake_in_transaction(repo_id, commit_id)
25+
26+
log.info(
27+
"Successfully processed flakes",
28+
extra=dict(repoid=repo_id, commit=commit_id),
29+
)
30+
31+
return {"successful": True}
32+
33+
34+
def process_flake_in_transaction(
35+
repo_id: int,
36+
commit_id: str,
2237
):
2338
uploads = ReportSession.objects.filter(
2439
report__report_type=CommitReport.ReportType.TEST_RESULTS.value,
@@ -90,14 +105,6 @@ def process_flake_for_repo_commit(
90105

91106
upload.state = "flake_processed"
92107
upload.save()
93-
django_transaction.commit()
94-
95-
log.info(
96-
"Successfully processed flakes",
97-
extra=dict(repoid=repo_id, commit=commit_id),
98-
)
99-
100-
return {"successful": True}
101108

102109

103110
def get_test_instances(

0 commit comments

Comments
 (0)