You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When executing a function on a separate thread that requires access to the Flask application context, the implementation was changed to use current_app instead of creating a new Flask app using create_app() with #5642. However, this change resulted in a RuntimeError with the message Working outside of application context.
This error is raised due to the use of current_app outside of a Flask application context. Flask's current_app is a proxy to the current active application instance, but it requires an active application context to function correctly.
While using current_app outside of an application context, Flask cannot determine the active application instance, leading to the error.
The text was updated successfully, but these errors were encountered:
Aadesh-Baral
changed the title
[BUG] Email sending functions not working due to RuntimeError: Working outside of application context
[BUG] Functions executed in separate thread not working due to RuntimeError: Working outside of application contextMay 29, 2023
Describe the bug
When executing a function on a separate thread that requires access to the Flask application context, the implementation was changed to use
current_app
instead of creating a new Flask app usingcreate_app()
with #5642. However, this change resulted in aRuntimeError
with the messageWorking outside of application context
.This error is raised due to the use of
current_app
outside of a Flask application context. Flask'scurrent_app
is a proxy to the current active application instance, but it requires an active application context to function correctly.While using
current_app
outside of an application context, Flask cannot determine the active application instance, leading to the error.The text was updated successfully, but these errors were encountered: