Configuration¶
Configuration for Flask-RQ uses the following Flask config keys.
- flask_rq.config.RQ_CONNECTION: str | dict[str, Any] | None = redis://127.0.0.1:6379/0¶
The default Redis connection to use for each queue. The default assumes a local server. This can be a URL string or a dict of arguments to pass to
RQ_CONNECTION_CLASS.
- flask_rq.config.RQ_QUEUES: list[str] | None = ["default"]¶
The names of the RQ queues to manage.
"default"will always be available even if it is not listed. Each queue will use the default connectionRQ_CONNECTIONunless it is overrdden inRQ_QUEUE_CONNECTIONS.
- flask_rq.config.RQ_ASYNC: bool | None = None¶
Controls RQ’s
rq.Queue.is_asyncsetting for every queue. Whenis_asyncis disabled, thenenqueueimmediately executes the job, rather than needing a separate worker process. However, a Redis server is still needed to handle RQ’s various bookkeeping needs. If this is the defaultNone, thenis_asyncis disabled ifapp.testingis enabled.See Testing for more information.
- flask_rq.config.RQ_QUEUE_CONNECTIONS: dict[str, str | dict[str, Any]] = {}¶
Specifies queues that will use a different connection than
RQ_CONNECTION. Each named queue must be listed inRQ_QUEUES, and"default"cannot be overridden. Each value can be a URL string, a string naming another queue to use its connection, or a dict of arguments to pass toRQ_CONNECTION_CLASS.See Queues for more information.