mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-08 00:18:12 +08:00
Adds more brokers
* added IronMQ * added Aws SQS * removed SafeRedis. During tests the 'safe' part wasn't consistent enough
This commit is contained in:
+13
-5
@@ -35,6 +35,16 @@ class Conf(object):
|
||||
|
||||
# Disque broker
|
||||
DISQUE = conf.get('disque', None)
|
||||
# Optional Authentication
|
||||
DISQUE_AUTH = conf.get('disque_auth', None)
|
||||
|
||||
# Amazon SQS broker
|
||||
SQS = conf.get('sqs', None)
|
||||
|
||||
# IronMQ broker
|
||||
IRONMQ = conf.get('ironmq', None)
|
||||
if IRONMQ and os.environ.get('IRONMQ_TOKEN'):
|
||||
IRONMQ['token'] = os.environ['IRONMQ_TOKEN']
|
||||
|
||||
# Name of the cluster or site. For when you run multiple sites on one redis server
|
||||
PREFIX = conf.get('name', 'default')
|
||||
@@ -46,9 +56,6 @@ class Conf(object):
|
||||
# Failures are always saved
|
||||
SAVE_LIMIT = conf.get('save_limit', 250)
|
||||
|
||||
# Maximum number of tasks that each cluster can work on
|
||||
QUEUE_LIMIT = conf.get('queue_limit', None)
|
||||
|
||||
# Number of workers in the pool. Default is cpu count if implemented, otherwise 4.
|
||||
WORKERS = conf.get('workers', False)
|
||||
if not WORKERS:
|
||||
@@ -63,6 +70,9 @@ class Conf(object):
|
||||
# sensible default
|
||||
WORKERS = 4
|
||||
|
||||
# Maximum number of tasks that each cluster can work on
|
||||
QUEUE_LIMIT = conf.get('queue_limit', None)
|
||||
|
||||
# Sets compression of redis packages
|
||||
COMPRESSED = conf.get('compress', False)
|
||||
|
||||
@@ -96,8 +106,6 @@ class Conf(object):
|
||||
# Django itself should raise an error if it's not configured
|
||||
SECRET_KEY = settings.SECRET_KEY
|
||||
|
||||
# The redis list key
|
||||
Q_LIST = 'django_q:{}:q'.format(PREFIX)
|
||||
# The redis stats key
|
||||
Q_STAT = 'django_q:{}:cluster'.format(PREFIX)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user