From e3d7f3108ed234b9a288c172e8b1a317a0d25f71 Mon Sep 17 00:00:00 2001 From: Ian Costanzo Date: Wed, 29 Jul 2020 09:19:08 -0700 Subject: [PATCH] Add a pause when only retries are in the queue Signed-off-by: Ian Costanzo --- aries_cloudagent/transport/outbound/manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aries_cloudagent/transport/outbound/manager.py b/aries_cloudagent/transport/outbound/manager.py index 31a8ac501e..977817a7a6 100644 --- a/aries_cloudagent/transport/outbound/manager.py +++ b/aries_cloudagent/transport/outbound/manager.py @@ -392,6 +392,9 @@ async def _process_loop(self): if self.outbound_buffer: if (not new_pending) and (not retry_count): await self.outbound_event.wait() + elif retry_count: + # only retries - yield here so we don't hog resources + await asyncio.sleep(0.05) else: break