Autogenerating module list in OnDemand interactive apps

Hi Martin.

Glad to see some work on something we are trying to also provide support around. The issue I think you are having is that the ERB is constantly being rendered and updated. So, each time that happens those module queries are running again and sending the info back.

To avoid this, try to cache those module result locally and use an initializer to set that location. There was a previous discourse that discussed something similar with slurm queues here Suggestions on generating dynamic form data - #3 by blixuga

But the main strategy here is to use the initializer to build that array of modules then just use that array for responses that’s cached, and not have the entire module query re-run each time the page updates.

Hopefully that helps, but let us know if you have any other questions or need some clarification.