Duplicate tasks when importing multiple students (spreadsheet)
Dantemss opened this issue · 0 comments
Dantemss commented
The spreadsheet import eventually calls CourseMembership::AddEnrollment
once for each student
Each call to that routine will create a job that runs ReassignPublishedPeriodTaskPlans
, resulting in potentially multiple Tasks for each TaskPlan for each student.
To fix, do both:
- Use serializable isolation and/or advisory locks to prevent multiple instances of
ReassignPublishedPeriodTaskPlans
from running on the same period at the same time. - Make the spreadsheet import only call
ReassignPublishedPeriodTaskPlans
once, at the end.