Is there any solution for my needs? Basically, I'm running the script that runs a certain function with APScheduler. So the script will run a function every 5 minutes.
PythonAnywhere can't do that because they don't support the APScheduler.. And it's very bad practice if we use an infinite loop on PythonAnywhere.
You can try Heroku and its Worker Dynos.
I found it much simple to set up than other services like AWS or Google Cloud Platform. You can have a basic account for free and play around.
They have as add-on Heroku Scheduler, which would allow you to avoid the infinite while
.
Heroku Scheduler
Run scheduled tasks every 10 minutes, every hour, or every day. Starting at $0/mo.
Run Jobs with Ease
Scheduler is an add-on for running jobs on your app at scheduled time intervals, much like cron in a traditional server environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With