mirror of https://github.com/celery/kombu.git
Allow connection pools with no limit
This commit is contained in:
parent
c86ced6746
commit
a574515aa9
|
@ -474,11 +474,12 @@ class ConnectionPool(Resource):
|
||||||
return copy(self.connection)
|
return copy(self.connection)
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for i in xrange(self.limit):
|
if self.limit:
|
||||||
conn = self.new()
|
for i in xrange(self.limit):
|
||||||
if i < self.preload:
|
conn = self.new()
|
||||||
conn.connect()
|
if i < self.preload:
|
||||||
self._resource.put_nowait(conn)
|
conn.connect()
|
||||||
|
self._resource.put_nowait(conn)
|
||||||
|
|
||||||
def prepare(self, resource):
|
def prepare(self, resource):
|
||||||
if not resource._connection:
|
if not resource._connection:
|
||||||
|
|
Loading…
Reference in New Issue