mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-30 06:28:11 +08:00
docs: adjusted for multiple brokers
This commit is contained in:
+59
-10
@@ -52,6 +52,14 @@ timeout
|
||||
The number of seconds a worker is allowed to spend on a task before it's terminated. Defaults to ``None``, meaning it will never time out.
|
||||
Set this to something that makes sense for your project. Can be overridden for individual tasks.
|
||||
|
||||
.. _retry:
|
||||
|
||||
retry
|
||||
~~~~~
|
||||
|
||||
The number of seconds a broker will wait for a cluster to finish a task, before it's presented again.
|
||||
Only works with brokers that support delivery receipts. Defaults to 60 seconds.
|
||||
|
||||
compress
|
||||
~~~~~~~~
|
||||
|
||||
@@ -100,20 +108,25 @@ The default behavior for schedules that didn't run while a cluster was down, is
|
||||
You can override this behavior by setting ``catch_up`` to ``False``. This will make those schedules run only once when the cluster starts and normal scheduling resumes.
|
||||
Defaults to ``True``.
|
||||
|
||||
.. _redis_configuration:
|
||||
|
||||
redis
|
||||
~~~~~
|
||||
|
||||
Connection settings for Redis. Defaults::
|
||||
|
||||
redis: {
|
||||
'host': 'localhost',
|
||||
'port': 6379,
|
||||
'db': 0,
|
||||
'password': None,
|
||||
'socket_timeout': None,
|
||||
'charset': 'utf-8',
|
||||
'errors': 'strict',
|
||||
'unix_socket_path': None
|
||||
# redis defaults
|
||||
Q_CLUSTER = {
|
||||
'redis': {
|
||||
'host': 'localhost',
|
||||
'port': 6379,
|
||||
'db': 0,
|
||||
'password': None,
|
||||
'socket_timeout': None,
|
||||
'charset': 'utf-8',
|
||||
'errors': 'strict',
|
||||
'unix_socket_path': None
|
||||
}
|
||||
}
|
||||
|
||||
For more information on these settings please refer to the `Redis-py <https://github.com/andymccurdy/redis-py>`__ documentation
|
||||
@@ -131,7 +144,7 @@ of the cache connection you want to use::
|
||||
'name': 'DJRedis',
|
||||
'workers': 4,
|
||||
'timeout': 90,
|
||||
'django_redis: 'default'
|
||||
'django_redis': 'default'
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +152,42 @@ of the cache connection you want to use::
|
||||
.. tip::
|
||||
Django Q uses your ``SECRET_KEY`` to encrypt task packages and prevent task crossover. So make sure you have it set up in your Django settings.
|
||||
|
||||
.. _disque_configuration:
|
||||
|
||||
disque_nodes
|
||||
~~~~~~~~~~~~
|
||||
If you want to use Disque as your broker, set this to a list of available Disque nodes and each cluster will randomly try to connect to them::
|
||||
|
||||
# example disque connection
|
||||
Q_CLUSTER = {
|
||||
'name': 'DisqueBroker',
|
||||
'workers': 4,
|
||||
'timeout': 60,
|
||||
'retry': 60,
|
||||
'disque_nodes': ['127.0.0.1:7711', '127.0.0.1:7712']
|
||||
}
|
||||
|
||||
|
||||
Django Q is also compatible with the `Tynd <https://disque.tynd.co/>`__ addon on `Heroku <https://heroku.com>`__::
|
||||
|
||||
# example Tynd connection
|
||||
import os
|
||||
|
||||
Q_CLUSTER = {
|
||||
'name': 'TyndBroker',
|
||||
'workers': 8,
|
||||
'timeout': 30,
|
||||
'retry': 60,
|
||||
'disque_nodes': os.environ['TYND_DISQUE_NODES'].split(','),
|
||||
'disque_auth': os.environ['TYND_DISQUE_AUTH']
|
||||
}
|
||||
|
||||
|
||||
disque_auth
|
||||
~~~~~~~~~~~
|
||||
|
||||
Optional Disque password for servers that require authentication.
|
||||
|
||||
cpu_affinity
|
||||
~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user