Forums

Best way to run a function every 30 seconds

I used to use apscheduler, but multithreading is disabled on PythonAnywhere, so that's a no-go. Creating 120 hourly tasks seems... wrong to say the least.

e: Bonus question: what's the best way to run a function in a file using tasks without losing the context?

We running a beta at the moment for what we're calling "always-on tasks" -- basically, you specify a script and it's started and runs essentially forever (apart from during scheduled downtime). If it exits, it's restarted, and if the machine it's on develops hardware problems, it will be started on a different machine.

Would you like to join the beta? If all goes well, we're planning to bring more people online with it this coming week. It's worth mentioning that it is very much a beta, and although things are working well at the moment, there may be problems...

Count me in, that sounds interesting! I don't mind beta issues either, my project is still pretty small. How do i join?

Great! I've added you to the list of people to invite when we next roll it out to more people -- like I said, hopefully over the course of this coming week.