Bird
0
0

What happens if the Celery worker is not running when a Flask app sends a task?

medium📝 Conceptual Q5 of 15
Flask - Background Tasks
What happens if the Celery worker is not running when a Flask app sends a task?
AThe task is lost and never executed
BFlask app crashes immediately
CThe task stays in the broker queue until a worker is available
DThe task executes synchronously in Flask
Step-by-Step Solution
Solution:
  1. Step 1: Understand task queuing behavior

    Celery tasks are sent to the broker, which queues them until workers pick them up.
  2. Step 2: Identify behavior when no worker runs

    If no worker is running, tasks remain queued in the broker until a worker starts.
  3. Final Answer:

    The task stays in the broker queue until a worker is available -> Option C
  4. Quick Check:

    Tasks queue in broker if no worker [OK]
Quick Trick: Tasks wait in broker queue if no worker runs [OK]
Common Mistakes:
MISTAKES
  • Thinking tasks get lost without workers
  • Assuming Flask crashes on task send
  • Believing tasks run synchronously without workers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes