Mybinder.org timeout

I realized it probably freezes up when launched in Voila, because code that kicks off when Voila starts has to get to a ‘done’ state with something to render before displaying. So that isn’t going to help you unless you still get your students to do something to kick off the background function after the Voila page rendering is completed, I think. I sort of forgot about Voila needing the rendered output completed to display.
You could verify for yourself that the idea of your students kicking off the background function is going to work by using that Timer notebook I linked to in the other thread. I just ran it for 23 minutes and the connection for the session is still good. (You need to adjust the limit for the timeit() and __init__() functions to run longer than 180 seconds.)
Another trick to keep it going longer is to open a terminal first before launching the Voila rendering but that sort of defeats the link to kick things off easily for novices.

Unless you can get your students to at least interact with something first…
I think you’re back to what I was hoping to avoid telling you. You’d need to run your own JupyterHub or Binderhub to have it not time out after 10 minutes with no interaction.

You’d want your background() function to do something and then sleep for like 8 minutes then do something again. Sleeping only a fraction of second is overkill (or may get you flagged on MyBinderas a bitcoin miner)?

Down the road, it would be easier if you shared your code in a way that can be copied and run. Either use tick marks to put code in the markdown, see ’ Block code formatting’ here or post links to snippets as a gist or at pastebin or something like that.
Or better yet put the notebook draft at one your Voila enabled repos and link to both the github page and a launch URL.

1 Like