Skip to content

Commit eacd74a

Browse files
authored
Merge pull request #57 from alimkhann/feature/user-ratings
fix: make rating aggregation updates atomic
2 parents f9ba0f9 + 4d981e3 commit eacd74a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

commitly-backend/app/services/roadmap_rating_store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ def action() -> RoadmapRating:
8888
)
8989
self._session.add(record)
9090

91-
# Update aggregated stats on GeneratedRoadmap
91+
# Update aggregated stats on GeneratedRoadmap atomically
9292
roadmap = (
9393
self._session.query(GeneratedRoadmap)
9494
.filter_by(repo_full_name=repo_full_name)
95+
.with_for_update()
9596
.one_or_none()
9697
)
9798

0 commit comments

Comments
 (0)