Flask - Background Tasks
You want to run a long task asynchronously in Flask and update a database after it finishes. Which approach correctly ensures Flask app context is available in the background task?
with app.app_context(): inside the task ensures context is active during task execution.with app.app_context(): inside the background task function. -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions