I have a couple of low priority regular tasks that I want my django web service to run.
- Pulling data from external API (once nightly)
- Generating alert emails to users (twice daily)
- Sending queued emails (somewhat frequently, as emails get generated)
Reading through the Render documents, it sounds like there are a few methods I could use to accomplish this, but I’m not sure which is best.
- cron: seems the simplest, but sounds like (at least a year ago Render cron jobs can not directly interact with web services. I could make a mirror of my web service that the job runs in, but that seems super wasteful. Alternatively, I could make a web endpoint that the cron job is pointed at. Seems better, but hacky. Also, the cost for these would be $1/mo per cron job? (Plus usage, but that should be pretty low for my jobs, as long as I didn’t re-deploy for each job…)
- jobs: This sounds more like what the right solution would be, as it is directly tied into the already deployed web service, but it does not appear that jobs are schedulable? But this has logging, so really seems like it would be handy. Maybe have cron trigger jobs? Cost seems to be included with the web service, but without the scheduler it needs additional effort.
- celery: It sounds like Render supports celery, but I’m a little unclear on how this would integrate with my django project. Do I just add the celery and celery-beat libraries to my project, and run /etc/init.d/celerybeat start in my build.sh? But I still need to make a Redis or RabbitMQ instance, which are $10/mo? This I assume would be the most robust system, but also definitely the most expensive.
What is the recommended way to trigger lightweight scheduled tasks? One of these, or something different?