forked from LBRYCommunity/lbry-sdk
remove closing peers from active connections
This commit is contained in:
parent
4e3b529aec
commit
b36cf3e36c
1 changed files with 8 additions and 4 deletions
|
@ -33,10 +33,14 @@ class BlobDownloader:
|
||||||
async def _request_blob():
|
async def _request_blob():
|
||||||
if blob.get_is_verified():
|
if blob.get_is_verified():
|
||||||
return
|
return
|
||||||
success, keep_connection = await request_blob(
|
try:
|
||||||
self.loop, blob, peer.address, peer.tcp_port, self.config.peer_connect_timeout,
|
success, keep_connection = await request_blob(
|
||||||
self.config.blob_download_timeout
|
self.loop, blob, peer.address, peer.tcp_port, self.config.peer_connect_timeout,
|
||||||
)
|
self.config.blob_download_timeout
|
||||||
|
)
|
||||||
|
finally:
|
||||||
|
if peer in self.active_connections:
|
||||||
|
self.active_connections.pop(peer)
|
||||||
if not keep_connection and peer not in self.ignored:
|
if not keep_connection and peer not in self.ignored:
|
||||||
self.ignored.add(peer)
|
self.ignored.add(peer)
|
||||||
log.debug("drop peer %s:%i", peer.address, peer.tcp_port)
|
log.debug("drop peer %s:%i", peer.address, peer.tcp_port)
|
||||||
|
|
Loading…
Reference in a new issue