Skip to content

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

Open

Description

@leamingrad

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions