forked from LBRYCommunity/lbry-sdk
Merge branch 'fix_on_high_cpu_usage_on_incomplete_streams'
This commit is contained in:
commit
0ec8739d5a
2 changed files with 5 additions and 1 deletions
|
@ -14,7 +14,7 @@ at anytime.
|
|||
|
||||
### Fixed
|
||||
* daemon cli spelling fixes
|
||||
*
|
||||
* high CPU usage when a stream is incomplete and the peers we're requesting from have no more blobs to send us
|
||||
|
||||
### Deprecated
|
||||
*
|
||||
|
|
|
@ -354,6 +354,10 @@ class AvailabilityRequest(RequestHelper):
|
|||
log.debug("Received a response to the availability request")
|
||||
# save available blobs
|
||||
blob_hashes = response_dict['available_blobs']
|
||||
if not blob_hashes:
|
||||
# should not send any more requests as it doesnt have any blob we need
|
||||
self.peer.update_score(-10.0)
|
||||
return True
|
||||
for blob_hash in blob_hashes:
|
||||
if blob_hash in request.request_dict['requested_blobs']:
|
||||
self.process_available_blob_hash(blob_hash, request)
|
||||
|
|
Loading…
Reference in a new issue