eduNEXT / eox-hooks

GNU Affero General Public License v3.0
3 stars 0 forks source link

fix: valitade enrollment for programs #42

Closed ErickMurillo closed 1 year ago

ErickMurillo commented 1 year ago

Hi team,

This PR is intended to fix the loop in the enrollments action when the trigger_enrollments_creation is activated.

For testing:

In Studio > select parent course > Settings > Advance Settings > Other Course Settings > add

{ "EDNX_TRIGGER_FOLLOWUP_ENROLLMENTS": [ { "course_id": "<same_parent_course_id>", "mode": "honor" } ] }

This will skip the enrollments with the same course_id as the parent. Only will be triggered when the course_id is different that the parent.

MaferMazu commented 1 year ago

Alright @ErickMurillo, I talked to Donato, and the real problem is that if someone mistakenly adds the same parent to the follow-up enrollments, it causes the task queue in the workers to get stuck for at least 4 hours. This PR doesn't fix a bug, but what it does is prevent the workers from getting filled up and being unable to execute more tasks asynchronously due to misconfiguration.