Merge pull request #507 from lbryio/fix_download_timeout

Fix downloading not timing out properly when unable to download sd blob
This commit is contained in:
Alex Grin 2017-03-03 17:14:00 -05:00 committed by GitHub
commit daa0ff036d
2 changed files with 3 additions and 2 deletions

View file

@ -20,6 +20,7 @@ at anytime.
### Fixed
* Fixed ExchangeRateManager freezing the app
* Fixed download not timing out properly when downloading sd blob
*
*

View file

@ -176,13 +176,13 @@ class GetStream(object):
log.info("Downloading lbry://%s (%s) --> %s", name, self.sd_hash[:6], self.download_path)
self.finished_deferred = self.downloader.start()
self.finished_deferred.addCallback(self.finish, name)
yield self.data_downloading_deferred
@defer.inlineCallbacks
def start(self, stream_info, name):
try:
safe_start(self.checker)
yield self.download(stream_info, name)
self.download(stream_info, name)
yield self.data_downloading_deferred
defer.returnValue(self.download_path)
except Exception as err:
safe_stop(self.checker)