Bird
0
0

A periodic task runs twice every minute instead of once. What might cause this?

medium📝 Debug Q7 of 15
Django - Celery and Background Tasks
A periodic task runs twice every minute instead of once. What might cause this?
ATwo Celery Beat instances running simultaneously
BTask function has a syntax error
CDjango settings.py missing timezone setting
DCelery worker concurrency set to 2
Step-by-Step Solution
Solution:
  1. Step 1: Understand multiple Beat instances effect

    Running two Beat schedulers causes duplicate task scheduling.
  2. Step 2: Exclude other causes

    Syntax errors prevent task running; timezone or concurrency don't cause duplicate runs.
  3. Final Answer:

    Two Celery Beat instances running simultaneously -> Option A
  4. Quick Check:

    Multiple Beat = duplicate task runs [OK]
Quick Trick: Only run one Celery Beat instance to avoid duplicate tasks [OK]
Common Mistakes:
MISTAKES
  • Blaming syntax errors for double runs
  • Ignoring multiple Beat processes
  • Confusing worker concurrency with scheduling

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes