Bird
0
0

You want a task to run every Monday at 8:30 AM using Celery Beat. Which schedule setting is correct?

hard📝 Application Q8 of 15
Django - Celery and Background Tasks
You want a task to run every Monday at 8:30 AM using Celery Beat. Which schedule setting is correct?
Acrontab(minute=30, hour=8, day_of_week=1)
Bcrontab(minute=8, hour=30, day_of_week='mon')
Ccrontab(minute=30, hour=8, day_of_week='mon')
Dcrontab(minute=30, hour=8, day_of_week='1-5')
Step-by-Step Solution
Solution:
  1. Step 1: Understand crontab parameters

    Minute=30, hour=8 means 8:30 AM; day_of_week='mon' means Monday.
  2. Step 2: Validate day_of_week format

    Using string 'mon' is valid; numeric 1 also works but string is clearer.
  3. Final Answer:

    crontab(minute=30, hour=8, day_of_week='mon') -> Option C
  4. Quick Check:

    Monday 8:30 AM = crontab with 'mon' and correct time [OK]
Quick Trick: Use day_of_week='mon' with correct hour and minute [OK]
Common Mistakes:
MISTAKES
  • Swapping hour and minute values
  • Using numeric day_of_week without quotes incorrectly
  • Using day_of_week='1-5' for Monday only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes