set the download manager before creating the first deferred

This commit is contained in:
Jack Robison 2018-09-21 16:42:35 -04:00
parent 9f0b1f3e25
commit fc69366092
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -44,8 +44,19 @@ class EncryptedFileDownloader(CryptStreamDownloader):
self.blob_manager, download_manager)
def _start(self):
def check_start_succeeded(success):
if success:
self.starting = False
self.stopped = False
self.completed = False
return True
else:
return self._start_failed()
self.download_manager = self._get_download_manager()
d = self._setup_output()
d.addCallback(lambda _: CryptStreamDownloader._start(self))
d.addCallback(lambda _: self.download_manager.start_downloading())
d.addCallbacks(check_start_succeeded)
return d
def _setup_output(self):