From 653ae80477e575d6c0607cbb47d7f586c2a046fd Mon Sep 17 00:00:00 2001 From: Ilan Steemers Date: Thu, 3 Sep 2015 14:41:03 +0200 Subject: [PATCH] Disque: If retry is 0 , explicitly set replicate to 1 --- django_q/brokers/disque.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django_q/brokers/disque.py b/django_q/brokers/disque.py index d763d87..89d7729 100644 --- a/django_q/brokers/disque.py +++ b/django_q/brokers/disque.py @@ -7,8 +7,9 @@ from django_q.conf import Conf class Disque(Broker): def enqueue(self, task): + retry = Conf.RETRY if Conf.RETRY > 0 else '{} REPLICATE 1'.format(Conf.RETRY) return self.connection.execute_command( - 'ADDJOB {} {} 500 RETRY {}'.format(self.list_key, task, Conf.RETRY)).decode() + 'ADDJOB {} {} 500 RETRY {}'.format(self.list_key, task, retry)).decode() def dequeue(self): task = self.connection.execute_command('GETJOB TIMEOUT 1000 FROM {}'.format(self.list_key))