-
Notifications
You must be signed in to change notification settings - Fork 48
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
Job running without Flask app context #50
Comments
I tried your code and wasn't able to reproduce it. Are you using the latest version of flask-rq2? I changed a lot of how this works in d4d5e52. |
See https://github.com/jezdez/rq2test for a quick test as well. |
Silly me... After looking at your test example I saw where I went wrong - I was starting my worker process using My bad for overlooking the CLI support section in the docs, but do you think adding an example of this to the Getting Started section would prevent similar confusion down the line? |
Hi, I'm trying to save to my db in one of my jobs, but I am getting the out of context error:
RuntimeError: No application found. Either work inside a view function or push an application context.
Here's a simple example that tests for the app context.
I can get around this by using
ScriptInfo().load_app()
, or with a delayed app instance import, but that's not ideal.The text was updated successfully, but these errors were encountered: