Simon-Initiative / oli-torus

Next Generation OLI Authoring and Delivery Platform
https://proton.oli.cmu.edu
MIT License
83 stars 35 forks source link

[ENHANCEMENT] [MER-3396] Async project export to fix gateway timeout #4958

Closed eliknebel closed 2 months ago

eliknebel commented 2 months ago

https://eliterate.atlassian.net/browse/MER-3396

This PR fixes an issue with exporting very large courses where the export processing takes longer than a browser connection (and default Phoenix/cowboy) can handle, resulting in a Gateway Timeout error and no way to download the export for a course.

Adjusting the HAProxy setting to a longer time window did not fix the issue on stellarator, so this required a code fix.

Now the export process is handled as a asynchronous background job using the existing AsyncExporter module. It will be important that users understand that in order to get the latest version of their project, they must first "Regenerate" before clicking the download button. This is likely not the best UX, but will work for the short term and unblocks the ability to download large projects.

When a job is in progress, a spinner is shown . Screenshot 2024-07-10 at 12 27 22 PM

When finished, LiveViews are notified and the exported project can be download via S3 link. Screenshot 2024-07-10 at 12 27 30 PM