Open
Description
Currently the course deletion takes a long time because we rely on callbacks to delete all course related objects. This requires the server to instantiate each record in ActiveRecord which is time and memory intensive, and could possible result in stack-overflow.
There are probably many ways to do this, but some possible ways include:
- Ensure that each component handle its own deletion; or
- Define a few
top-level
course objects, which would each have its own deletion logic.
The subsequent deletion of objects can be implemented as jobs (invoked with execute_after_commit
) to ensure that the user doesn't get stuck waiting for the entire course to delete.