fix: non-blocking status endpoint
Description
This MR implements a check and quick timeout on the /status
endpoint to prevent blocking the process when fetching nonexistent results.
It also improved error handling in tasks so that exceptions don't cause confusion regarding what happened to a task.
Testing instructions
- Set this version of clone-course on a devstack, sandbox, or make use of https://studio.lms.paulo.eshe.opencraft.hosting/
- Request the
/clone_course/status
endpoint with a nonexistent id. - Ensure it returns correctly in a timely manner.
- Request
/clone_course/clone
with an inexistent source course ID and take note of the task ID. - Request the status endpoint to query the results of the above request.
- Ensure the validation error is properly explained in the results.
Edited by Paulo Viadanna