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

Handling of RQ_ASYNC is confusing when using the application factory pattern #81

Open
leamingrad opened this issue Feb 7, 2019 · 0 comments

Comments

@leamingrad
Copy link

When using the application factory pattern, the RQ_ASYNC configuration is only respected if it has not already been set for the task queue being initialized.

Concrete example to show the behaviour:

rq = RQ()  # rq._is_async is set to None
app = Flask(__name__)
app.config['RQ_ASYNC'] = False
rq.init_app(app)  # rq._is_async is set to False
app.config['RQ_ASYNC'] = True
rq.init_app(app)  # rq._is_async is unchanged

I'm not sure if this is a bug or not - from a look at the code, my guess is that the intention is that RQ_ASYNC does not override constructing the queue with the is_async argument set manually, which seems like a sensible stance. However, it does seem a bit strange - altering any of the other RQ_X options will take effect on a re-init.

What is the expected behavior here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant