flask-rq
flask-rq copied to clipboard
Use app context when performing job
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 inFlaskRQWorker.perform_job