Hi there,
I'm looking to setup a script to run for weeks, if not months. Right now, it tends to terminate unexpectedly and requires a manual restart.
https://help.pythonanywhere.com/pages/LongRunningTasks
I found this explanation solid, thanks very much - but had a few n00b questions.
Instead of importing my_module as described, I'm likely going to inject the socket code into my existing long running script.
- How should I then setup the scheduled task to make sure that the script continues to run - i.e do nothing if socket is open, else run the script again?
- I am not too familiar with the socket module, can I assume that if my long runningscript exits the socket will be closed/unbound automatically?
Thanks.