-
Notifications
You must be signed in to change notification settings - Fork 4
Configuration
Manabu Niseki edited this page Apr 9, 2022
·
7 revisions
Configuration should be stored in environment variables, or in a .env
file.
Name | Type | Desc. | Default |
---|---|---|---|
ARQ_DASHBOARD_REDIS_URL |
str (DatabaseURL ) |
Default Redis URL (Redis URL of the default query) | redis://localhost:6379 |
ARQ_DASHBOARD_MAX_AT_ONCE | Optional[int] |
Maximum number of concurrently running tasks at any given time | 10 |
ARQ_DASHBOARD_MAX_PER_SECONDS | Optional[int] |
Number of tasks spawned per second | None |
ARQ_CACHE_TTL | int |
Max time (seconds) for which a cached result is valid | 60 |
ARQ_CACHE_SIZE | int |
Max number of results that are cached | 32 |
ARQ_DESERIALIZER | Optional[Deserializer] |
Function that deserializes bytes into Python objects. | None |
ARQ_QUEUES | Dict[str, RedisSettings] |
ARQ_QUEUES
(Dict[str, RedisSettings]
) is a dict mapping a queue name to a Redis settings.
The following is the default value. (default_queue_name
= arq:queue
)
ARQ_QUEUES = {
default_queue_name: RedisSettings(
host=str(REDIS_URL.hostname),
port=str(REDIS_URL.port),
password=REDIS_URL.password,
)
}
You can add a queue by updating this variable.
settings.ARQ_QUEUES["another.queue"] = RedisSettings(host="localhost", port=6379)
ARQ_DESERIALIZER
(Optional[Deserializer]
) is a function deserializes bytes into Python object. Defaults to pickle.loads
.
You can set your own deserializer.
def deserializer(data: bytes):
return ...
ARQ_DESERIALIZER = deserializer