forked from LBRYCommunity/lbry-sdk
fix dht status error during startup
This commit is contained in:
parent
ba818354af
commit
c3b0151943
2 changed files with 2 additions and 1 deletions
|
@ -88,6 +88,7 @@ class BlobDownloader:
|
||||||
if task and not task.done():
|
if task and not task.done():
|
||||||
task.cancel()
|
task.cancel()
|
||||||
await blob.close()
|
await blob.close()
|
||||||
|
log.info("downloaded %s", blob_hash[:8])
|
||||||
return blob
|
return blob
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
while self.active_connections:
|
while self.active_connections:
|
||||||
|
|
|
@ -349,7 +349,7 @@ class DHTComponent(Component):
|
||||||
|
|
||||||
async def get_status(self):
|
async def get_status(self):
|
||||||
return {
|
return {
|
||||||
'node_id': binascii.hexlify(self.dht_node.protocol.node_id),
|
'node_id': None if not self.dht_node else binascii.hexlify(self.dht_node.protocol.node_id),
|
||||||
'peers_in_routing_table': 0 if not self.dht_node else len(self.dht_node.protocol.routing_table.get_peers())
|
'peers_in_routing_table': 0 if not self.dht_node else len(self.dht_node.protocol.routing_table.get_peers())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue