forked from LBRYCommunity/lbry-sdk
stop failed downloader outside of GetStream
This commit is contained in:
parent
b0a3771ccf
commit
250855d45d
1 changed files with 3 additions and 4 deletions
|
@ -76,7 +76,7 @@ class GetStream(object):
|
||||||
Check if we've got the first data blob in the stream yet
|
Check if we've got the first data blob in the stream yet
|
||||||
"""
|
"""
|
||||||
self.timeout_counter += 1
|
self.timeout_counter += 1
|
||||||
if self.timeout_counter >= self.timeout:
|
if self.timeout_counter > self.timeout:
|
||||||
if not self.data_downloading_deferred.called:
|
if not self.data_downloading_deferred.called:
|
||||||
self.data_downloading_deferred.errback(DownloadDataTimeout(self.sd_hash))
|
self.data_downloading_deferred.errback(DownloadDataTimeout(self.sd_hash))
|
||||||
|
|
||||||
|
@ -213,9 +213,8 @@ class GetStream(object):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
yield self.data_downloading_deferred
|
yield self.data_downloading_deferred
|
||||||
except Exception as err:
|
except DownloadDataTimeout as err:
|
||||||
self.downloader.stop()
|
|
||||||
safe_stop_looping_call(self.checker)
|
safe_stop_looping_call(self.checker)
|
||||||
raise
|
raise err
|
||||||
|
|
||||||
defer.returnValue((self.downloader, self.finished_deferred))
|
defer.returnValue((self.downloader, self.finished_deferred))
|
||||||
|
|
Loading…
Reference in a new issue