mirror of https://github.com/celery/kombu.git
Fixes bug in producer pool handling
This commit is contained in:
parent
6e7e591eaa
commit
156da0805d
|
@ -35,7 +35,8 @@ class ProducerPool(Resource):
|
||||||
return Producer(connection)
|
return Producer(connection)
|
||||||
|
|
||||||
def create_producer(self):
|
def create_producer(self):
|
||||||
return self.Producer(self.connections.acquire(block=True))
|
connection = self.connections.acquire(block=True)
|
||||||
|
return self.Producer(connection)
|
||||||
|
|
||||||
def new(self):
|
def new(self):
|
||||||
return lambda: self.create_producer()
|
return lambda: self.create_producer()
|
||||||
|
@ -48,6 +49,7 @@ class ProducerPool(Resource):
|
||||||
def prepare(self, p):
|
def prepare(self, p):
|
||||||
if callable(p):
|
if callable(p):
|
||||||
p = p()
|
p = p()
|
||||||
|
if not p.channel:
|
||||||
p.connection = self.connections.acquire(block=True)
|
p.connection = self.connections.acquire(block=True)
|
||||||
p.revive(p.connection.default_channel)
|
p.revive(p.connection.default_channel)
|
||||||
return p
|
return p
|
||||||
|
|
Loading…
Reference in New Issue