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

Commit 9de1f0d

Browse files
fix: handle TA db replication lag (#1220)
1 parent e4bd4df commit 9de1f0d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

services/test_analytics/ta_processing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ def get_ta_processing_info(
4747
commitid: str,
4848
commit_yaml: dict[str, Any],
4949
) -> TAProcInfo:
50-
repository = Repository.objects.get(repoid=repoid)
50+
repository = Repository.objects.using("default").get(repoid=repoid)
5151

52-
commit = Commit.objects.get(repository=repository, commitid=commitid)
52+
commit = Commit.objects.using("default").get(
53+
repository=repository, commitid=commitid
54+
)
5355
branch = commit.branch
5456

5557
user_yaml: UserYaml = UserYaml(commit_yaml)

services/test_analytics/ta_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def ta_processor_impl(
3939
if upload_id is None:
4040
return False
4141

42-
upload = ReportSession.objects.get(id=upload_id)
42+
upload = ReportSession.objects.using("default").get(id=upload_id)
4343
if upload.state == "processed":
4444
# don't need to process again because the intermediate result should already be in redis
4545
return False

0 commit comments

Comments
 (0)