Skip to content
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

Use app context when performing job #27

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joostdevries
Copy link
Collaborator

@joostdevries joostdevries commented May 11, 2016

Based on #26, fixes #10, related to #3

This PR should make sure we use the Flask app's app_context when performing a job. This allows you to access stuff like flask.url_for etc.

Changes:

  • Register the app on module global _flask_app
  • Use that variable instead of current_app so you can access the config without app context present.
  • Subclass rq.Worker to use the app context in FlaskRQWorker.perform_job

@joostdevries joostdevries mentioned this pull request May 11, 2016
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Being able to submit jobs without pushing the context around
1 participant