Skip to content

Commit

Permalink
fix: race condition in analytics loader (#4498)
Browse files Browse the repository at this point in the history
  • Loading branch information
zawan-ila authored Nov 28, 2024
1 parent dce1534 commit 9c392ea
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def ingest(self):
program = program_dict['program']
program.enrollment_count = program_dict['count']
program.recent_enrollment_count = program_dict['recent_count']
program.save(suppress_publication=True)
program.save(update_fields=['enrollment_count', 'recent_enrollment_count'], suppress_publication=True)
logger.info('Updating program: %s', program.uuid)

def _process_course_run_summary(self, course_run_summary):
Expand All @@ -76,7 +76,7 @@ def _process_course_run_summary(self, course_run_summary):
# Update course run counts
course_run.enrollment_count = course_run_count
course_run.recent_enrollment_count = course_run_recent_count
course_run.save(suppress_publication=True)
course_run.save(update_fields=['enrollment_count', 'recent_enrollment_count'], suppress_publication=True)

# Add course run total to course total in dictionary
if course.uuid in self.course_dictionary:
Expand Down

0 comments on commit 9c392ea

Please sign in to comment.