From da601818a362f3b72d9c8f089be46417338890d2 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 28 Oct 2016 16:47:45 -0400 Subject: [PATCH] return from restore_status properly --- lbrynet/lbryfilemanager/EncryptedFileDownloader.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lbrynet/lbryfilemanager/EncryptedFileDownloader.py b/lbrynet/lbryfilemanager/EncryptedFileDownloader.py index db55ac3ad..7ce5adb9d 100644 --- a/lbrynet/lbryfilemanager/EncryptedFileDownloader.py +++ b/lbrynet/lbryfilemanager/EncryptedFileDownloader.py @@ -14,7 +14,7 @@ from lbrynet.lbryfilemanager.EncryptedFileStatusReport import EncryptedFileStatu from lbrynet.interfaces import IStreamDownloaderFactory from lbrynet.lbryfile.StreamDescriptor import save_sd_info from lbrynet.reflector import reupload -from lbrynet.conf import REFLECTOR_SERVERS +from lbrynet.conf import settings log = logging.getLogger(__name__) @@ -67,10 +67,11 @@ class ManagedEncryptedFileDownloader(EncryptedFileSaver): d.addCallbacks(_save_claim_id, lambda err: _notify_bad_claim(name, txid)) return d - + reflector_server = random.choice(settings.reflector_servers) d.addCallback(_save_sd_hash) d.addCallback(lambda r: _save_claim(r[0], r[1]) if r else None) + d.addCallback(lambda _: reupload.check_and_restore_availability(self, reflector_server)) d.addCallback(lambda _: self.lbry_file_manager.get_lbry_file_status(self)) def restore_status(status): @@ -83,10 +84,6 @@ class ManagedEncryptedFileDownloader(EncryptedFileSaver): return defer.succeed(True) d.addCallback(restore_status) - - reflector_server = random.choice(REFLECTOR_SERVERS) - - d.addCallback(lambda _: reupload.check_and_restore_availability(self, reflector_server)) return d def stop(self, err=None, change_status=True):