mirror of https://github.com/celery/kombu.git
reuse connection
This commit is contained in:
parent
255b85229b
commit
ff7c1e3041
|
@ -434,7 +434,7 @@ class Connection(object):
|
|||
if not reraise_as_library_errors:
|
||||
ctx = self._dummy_context
|
||||
with ctx():
|
||||
self._connection = retry_over_time(
|
||||
self._connection = self._connection or retry_over_time(
|
||||
self._connection_factory, self.recoverable_connection_errors,
|
||||
(), {}, on_error, max_retries,
|
||||
interval_start, interval_step, interval_max,
|
||||
|
|
|
@ -144,6 +144,10 @@ class test_Connection:
|
|||
assert not _connection.connected
|
||||
assert isinstance(conn.transport, Transport)
|
||||
|
||||
def test_reuse_connection(self):
|
||||
conn = self.conn
|
||||
assert conn.connect() is conn.connection is conn.connect()
|
||||
|
||||
def test_connect_no_transport_options(self):
|
||||
conn = self.conn
|
||||
conn._ensure_connection = Mock()
|
||||
|
|
Loading…
Reference in New Issue