Avoid waiting prior to reconnection when stopping
@@ -342,7 +342,8 @@ class Ingest(object):
if connection is None:
await waiter
else:
- await asyncio.wait_for(waiter,
+ await asyncio.wait_for(
+ waiter,
cls._max_readings_insert_batch_connection_idle_seconds)
except asyncio.CancelledError:
# Don't assume the list is empty
@@ -436,6 +437,7 @@ class Ingest(object):
break
else:
if connection is None:
+ if not cls._stop:
# Connection failure
waiter = asyncio.ensure_future(asyncio.sleep(
randint(1,
