mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-02 03:08:12 +08:00
Makes bulk a general setting
This commit is contained in:
@@ -13,7 +13,7 @@ class IronMQBroker(Broker):
|
|||||||
t = self.task_cache.pop()
|
t = self.task_cache.pop()
|
||||||
else:
|
else:
|
||||||
timeout = Conf.RETRY or None
|
timeout = Conf.RETRY or None
|
||||||
tasks = self.connection.get(timeout=timeout, wait=1, max=Conf.IRON_MQ_MAX)['messages']
|
tasks = self.connection.get(timeout=timeout, wait=1, max=Conf.BULK)['messages']
|
||||||
if tasks:
|
if tasks:
|
||||||
t = tasks.pop()
|
t = tasks.pop()
|
||||||
if tasks:
|
if tasks:
|
||||||
|
|||||||
+4
-1
@@ -39,7 +39,6 @@ class Conf(object):
|
|||||||
|
|
||||||
# IronMQ broker
|
# IronMQ broker
|
||||||
IRON_MQ = conf.get('iron_mq', None)
|
IRON_MQ = conf.get('iron_mq', None)
|
||||||
IRON_MQ_MAX = conf.get('iron_mq_max', 1)
|
|
||||||
|
|
||||||
# Name of the cluster or site. For when you run multiple sites on one redis server
|
# Name of the cluster or site. For when you run multiple sites on one redis server
|
||||||
PREFIX = conf.get('name', 'default')
|
PREFIX = conf.get('name', 'default')
|
||||||
@@ -81,6 +80,10 @@ class Conf(object):
|
|||||||
# Only works with brokers that guarantee delivery. Defaults to 60 seconds.
|
# Only works with brokers that guarantee delivery. Defaults to 60 seconds.
|
||||||
RETRY = conf.get('retry', 60)
|
RETRY = conf.get('retry', 60)
|
||||||
|
|
||||||
|
# Sets the amount of tasks the cluster will try to pop off the broker.
|
||||||
|
# If it supports bulk gets.
|
||||||
|
BULK = conf.get('bulk', 1)
|
||||||
|
|
||||||
# The Django Admin label for this app
|
# The Django Admin label for this app
|
||||||
LABEL = conf.get('label', 'Django Q')
|
LABEL = conf.get('label', 'Django Q')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user