From a574515aa9b599c2341a10aa7cc2a8c66f01f856 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Tue, 30 Nov 2010 19:56:12 +0100 Subject: [PATCH] Allow connection pools with no limit --- kombu/connection.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kombu/connection.py b/kombu/connection.py index 84f1cf14..55d02558 100644 --- a/kombu/connection.py +++ b/kombu/connection.py @@ -474,11 +474,12 @@ class ConnectionPool(Resource): return copy(self.connection) def setup(self): - for i in xrange(self.limit): - conn = self.new() - if i < self.preload: - conn.connect() - self._resource.put_nowait(conn) + if self.limit: + for i in xrange(self.limit): + conn = self.new() + if i < self.preload: + conn.connect() + self._resource.put_nowait(conn) def prepare(self, resource): if not resource._connection: