mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 05:18:12 +08:00
Fixes connectionerror bug on 2.7
This commit is contained in:
@@ -48,4 +48,4 @@ class Disque(Broker):
|
|||||||
return redis_client
|
return redis_client
|
||||||
except redis.exceptions.ConnectionError:
|
except redis.exceptions.ConnectionError:
|
||||||
continue
|
continue
|
||||||
raise ConnectionError('Could not connect to any Disque nodes')
|
raise redis.exceptions.ConnectionError('Could not connect to any Disque nodes')
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
import pytest
|
import pytest
|
||||||
import os
|
import os
|
||||||
|
import redis
|
||||||
from django_q.conf import Conf
|
from django_q.conf import Conf
|
||||||
from django_q.brokers import get_broker, Broker
|
from django_q.brokers import get_broker, Broker
|
||||||
|
|
||||||
@@ -58,7 +59,7 @@ def test_disque():
|
|||||||
sleep(1.5)
|
sleep(1.5)
|
||||||
assert broker.queue_size() == 0
|
assert broker.queue_size() == 0
|
||||||
Conf.DISQUE = ['127.0.0.1:7712', '127.0.0.1:7713']
|
Conf.DISQUE = ['127.0.0.1:7712', '127.0.0.1:7713']
|
||||||
with pytest.raises(ConnectionError):
|
with pytest.raises(redis.exceptions.ConnectionError):
|
||||||
broker.get_connection()
|
broker.get_connection()
|
||||||
broker.delete_queue()
|
broker.delete_queue()
|
||||||
assert broker.queue_size() == 0
|
assert broker.queue_size() == 0
|
||||||
|
|||||||
Reference in New Issue
Block a user