From 60f7766cf73e9c1d306ebb24988d4de632340c68 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 1 May 2019 02:55:51 -0300 Subject: [PATCH] small adjustment to new_peer_or_finished --- lbrynet/blob_exchange/downloader.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lbrynet/blob_exchange/downloader.py b/lbrynet/blob_exchange/downloader.py index 128f720f7..85cf3c38b 100644 --- a/lbrynet/blob_exchange/downloader.py +++ b/lbrynet/blob_exchange/downloader.py @@ -57,14 +57,13 @@ class BlobDownloader: del self.connections[peer] elif transport: log.debug("keep peer %s:%i", peer.address, peer.tcp_port) - if bytes_received: - self.failures[peer] = 0 + self.failures[peer] = 0 self.connections[peer] = transport rough_speed = (bytes_received / (self.loop.time() - start)) if bytes_received else 0 self.scores[peer] = rough_speed async def new_peer_or_finished(self): - active_tasks = list(self.active_connections.values()) + [asyncio.sleep(0.2)] + active_tasks = list(self.active_connections.values()) + [asyncio.sleep(1)] await asyncio.wait(active_tasks, loop=self.loop, return_when='FIRST_COMPLETED') def cleanup_active(self):