Bird
0
0

You wrote this code to enqueue a task in Flask with rq:

medium📝 Debug Q14 of 15
Flask - Background Tasks
You wrote this code to enqueue a task in Flask with rq:
queue.enqueue(my_task, arg1, arg2)

But the task never runs. What is the most likely reason?
ARedis server is not installed
BThe task function my_task is missing
CYou forgot to start the rq worker process
DYou used enqueue instead of run
Step-by-Step Solution
Solution:
  1. Step 1: Check rq worker role

    rq worker must be running to process tasks from the queue.
  2. Step 2: Identify missing worker

    If tasks never run, the worker process is likely not started.
  3. Final Answer:

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

    Worker must run to process tasks [OK]
Quick Trick: Always run rq worker to process queued tasks [OK]
Common Mistakes:
MISTAKES
  • Assuming enqueue runs task immediately
  • Not starting rq worker process
  • Confusing Redis installation with worker running

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes