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 connection RQ_CONNECTION unless it is overrdden in RQ_QUEUE_CONNECTIONS.

flask_rq.config.RQ_ASYNC: bool | None = None

Controls RQ’s rq.Queue.is_async setting for every queue. When is_async is disabled, then enqueue immediately 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 default None, then is_async is disabled if app.testing is 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 in RQ_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 to RQ_CONNECTION_CLASS.

See Queues for more information.

flask_rq.config.RQ_CONNECTION_CLASS: str | type[redis.Redis] | None = redis.Redis

The class to use for each Redis connection. This can be a string to import or a class.