-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with sqlalchemy (cannot join current thread and working outside of app context) #240
Comments
Hi, Check if sqlalchemy have a config like check_same_thread=False?
|
I'm not quite sure what happened, but it seems to work now? I literally changed nothing. I just haven't touched the project since the 7th. I remember having to use |
I think I found the source of my issue. I tried running a job that does a |
I noticed that when I comment out my @app.teardown_appcontext
def stop_scheduler(exception=None):
scheduler.shutdown() |
Hi, I'm trying to create a background job that interacts with my database via flask-sqlalchemy and am having some trouble. Here is some (simplified) code that I'm trying to run:
When I include the
with app.app_context()
, I get the error:RuntimeError: cannot join current thread
, but if I remove thewith app.app_context()
, it obv doesn't work (Working outside of application context). Is there something I missed in the docs? I looked at the examples and I think I set everything up correctly.The text was updated successfully, but these errors were encountered: