From d024433d1b947e000ee934c6e473191dfd0d0df9 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 13 May 2019 13:34:49 -0300 Subject: [PATCH] simplify accumulate task --- lbrynet/dht/node.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lbrynet/dht/node.py b/lbrynet/dht/node.py index 62ec7f3d9..f3e7c340e 100644 --- a/lbrynet/dht/node.py +++ b/lbrynet/dht/node.py @@ -199,13 +199,10 @@ class Node: async def _accumulate_search_junction(self, search_queue: asyncio.Queue, result_queue: asyncio.Queue): tasks = [] - async def __start_producing_task(): + try: while True: blob_hash = await search_queue.get() tasks.append(asyncio.create_task(self._value_producer(blob_hash, result_queue))) - tasks.append(asyncio.create_task(__start_producing_task())) - try: - await asyncio.wait(tasks) finally: for task in tasks: task.cancel()