Прескочи на главни садржај
🔒 Режим прегледа. Првих петнаест Foundations лекција је бесплатно; ова је Pro. Покрените 7-дневни trial да откључате едитор, AI савете и остатак курса. Картица је обавезна, можете отказати у било ком тренутку у Dashboard.
Покрени 7-дневни trial →
⚡
← Kursevi
›
FastAPI Production
›
Module 3 · Async + Background · Recap
›
Позадински задаци — три нивоа
quiz
67 / 105
🇷🇸
SR
▼
↗
Подели
⋯
Више
+100 XP
📋
Zadatak
📖
Teorija
🤖
AI Pomoć
Zadatak
🌐 shown in EN
📝 **Question:** When is fastapi.BackgroundTasks the WRONG choice? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
🎯 Kviz
Pitanje
📝 **Question:** When is fastapi.BackgroundTasks the WRONG choice? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
A
BackgroundTasks should be replaced with a real queue only when the task takes longer than 30 seconds, because anything shorter typically completes before the worker is reaped during a normal redeploy cycle even with rolling restarts
B
Any work whose loss would harm the user — emails, charges, webhook deliveries, notifications
C
Once you have more than one background task per request, you must move to Celery because BackgroundTasks only supports a single task per response and silently drops any subsequent calls within the same response cycle every time
D
When the work is async, use Celery; when it's sync, BackgroundTasks is fine — the deciding factor is whether the function needs an event loop, not whether the work itself is durable or has user-facing side effects to manage carefully
Odgovori
💬
Kontaktiraj podršku