diff --git a/.travis.yml b/.travis.yml index c2b5a6cdb2770133c3c7b84aff327a0c22104494..8c29529ba97729f7473c41cbbc23eb838bb63a07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,7 @@ sudo: required script: - nosetests --with-coverage install: - - pip install coverage - - pip install codeclimate-test-reporter + - pip install coverage codeclimate-test-reporter - pip install -r requirements.txt after_success: - CODECLIMATE_REPO_TOKEN=e8e05973a6c49139de5f98013cd285f9238b78d20f053f37f6e7deeab2c2c52f codeclimate-test-reporter diff --git a/coolamqp/handler.py b/coolamqp/handler.py index 93e2f056d6f88327a592ff3adce2643a1214d1eb..007c0c348514a05993fb8afe66eb37b0f9ae0bc4 100644 --- a/coolamqp/handler.py +++ b/coolamqp/handler.py @@ -63,11 +63,7 @@ class ClusterHandlerThread(threading.Thread): for queue in self.queues_by_consumer_tags.values(): self.backend.queue_declare(queue) if queue.exchange is not None: - if isinstance(queue.exchange, Exchange): - self.backend.queue_bind(queue, queue.exchange) - else: - for exchange in queue.exchange: - self.backend.queue_bind(queue, exchange) + self.backend.queue_bind(queue, queue.exchange) self.backend.basic_consume(queue) except ConnectionFailedError as e: @@ -82,10 +78,7 @@ class ClusterHandlerThread(threading.Thread): if self.is_terminating: raise SystemError('Thread was requested to terminate') - if exponential_backoff_delay < 60: - exponential_backoff_delay *= 2 - else: - exponential_backoff_delay = 60 + exponential_backoff_delay = max(60, exponential_backoff_delay * 2) else: self.cluster.connected = True self.event_queue.put(ConnectionUp(initial=self.first_connect)) diff --git a/coolamqp/messages.py b/coolamqp/messages.py index a3667bdaffa7891d41db024bdc46c47ada5f7034..74e068ac2d4b40c0c7782ab5831455ab4fa6f690 100644 --- a/coolamqp/messages.py +++ b/coolamqp/messages.py @@ -98,8 +98,7 @@ class Queue(object): reestablished, this name will CHANGE AGAIN, and be reflected in this object. This change will be done before CoolAMQP signals reconnection. :param durable: Is the queue durable? - :param exchange: Exchange(s) this queue is bound to. None for no binding. - This might be a single Exchange object, or an iterable of exchanges. + :param exchange: Exchange for this queue to bind to. None for no binding. :param exclusive: Is this queue exclusive? :param auto_delete: Is this queue auto_delete ? """ diff --git a/tests/test_basics.py b/tests/test_basics.py index 6507dc83ce31d9303619e65c3fb062f06adda250..092acd20ebe3257d5e9d34a51f45944dea3d2eec 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -21,7 +21,6 @@ class TestThings(unittest.TestCase): self.assertIsInstance(amqp.drain(1), ConnectionUp) amqp.shutdown() - class TestBasics(unittest.TestCase): def setUp(self): self.amqp = getamqp() @@ -144,4 +143,3 @@ class TestBasics(unittest.TestCase): self.assertIsInstance(self.amqp.drain(wait=4), MessageReceived) self.assertIsInstance(self.amqp.drain(wait=4), MessageReceived) -