The problem
Suppose you have the following task:
import time
from django_project.celery import app # set up according to https://do...
For further actions, you may consider blocking this person and/or reporting abuse
My application has 2 periodic tasks which run for a couple of seconds, and run once per day.
Do you recommend using this method ? It's the most natural thing that comes to mind
Yeah! Especially if you don't really need to scale this solution to thousands different tasks that launch millions of times.
Since writing this article I've moved on to a different project with a big load of users. And you know what? It uses the same solution! Except on this project we store
last_runin Redis, not Postgres, since we don't need to persist it forever.sorry for the late reply and thank you so much for your reply. I guess I will adopt this strategy for my task. Right now it is just the one!
happy new year ^^
Curious what is the scale of your tasks? Django celery beat was not necessarily built to handle load, though if you have separated this database to only be used for beat, that may help.
My tasks are network-intensive, and are supposed to run for a month or so.
A separate database is a great idea for this kind of tasks, thanks!