flask-rq icon indicating copy to clipboard operation
flask-rq copied to clipboard

Use app context when performing job

Open joostdevries opened this issue 8 years ago • 0 comments

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 avatar May 11 '16 10:05 joostdevries