Bird
0
0

You wrote a background task but it never runs. Which of these is the most likely cause?

medium📝 Debug Q14 of 15
Django - Celery and Background Tasks
You wrote a background task but it never runs. Which of these is the most likely cause?
AYou used the @background decorator incorrectly on a normal function.
BYou called the task function without parentheses.
CYou forgot to start the background task worker process.
DYou defined the task inside a Django model class.
Step-by-Step Solution
Solution:
  1. Step 1: Identify background task execution requirements

    Background tasks need a worker process running to execute queued tasks.
  2. Step 2: Evaluate options

    You forgot to start the background task worker process. is the common cause: forgetting to start the worker. Other options describe syntax or design issues but don't prevent task execution as directly.
  3. Final Answer:

    You forgot to start the background task worker process. -> Option C
  4. Quick Check:

    Worker process must run = B [OK]
Quick Trick: Always start the background task worker to run tasks [OK]
Common Mistakes:
MISTAKES
  • Not running the worker process
  • Misusing decorator but still expecting task to run
  • Calling task without parentheses (does nothing)
  • Defining tasks inside models (not typical but not always blocking)

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes