Rethinking total_run_count reset for one-off tasks in is_due #730
Unanswered
AryanHamedani
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
ModelEntry
class in django-celery-beat includes a logic snippet that resetstotal_run_count
to 0 for one-off tasks after they run once:This behavior raises a discussion point:
- Preserving run history:
While disabling the task makes sense, resetting total_run_count loses valuable information about its execution history. Understanding past execution is crucial for debugging, auditing, and future scheduling decisions.
- Redundant state update:
Is disabling the task sufficient to prevent future runs? Does the reset of total_run_count add unnecessary complexity?
- Alternative solutions:
Are there better ways to handle one-off tasks after they run once, while still maintaining a record of their execution?
I propose this discussion to solicit community input on:
Beta Was this translation helpful? Give feedback.
All reactions