From 867275461c20f0fb3363f36f47e20b7570e985a1 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sun, 12 Feb 2017 21:20:54 -0500 Subject: [PATCH] feedback from job --- lbrynet/lbryfilemanager/EncryptedFileManager.py | 5 ++++- lbrynet/lbrynet_daemon/Daemon.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lbrynet/lbryfilemanager/EncryptedFileManager.py b/lbrynet/lbryfilemanager/EncryptedFileManager.py index 1813231d2..1fca82272 100644 --- a/lbrynet/lbryfilemanager/EncryptedFileManager.py +++ b/lbrynet/lbryfilemanager/EncryptedFileManager.py @@ -43,6 +43,7 @@ class EncryptedFileManager(object): self.stream_info_manager = stream_info_manager self.sd_identifier = sd_identifier self.lbry_files = [] + self.lbry_files_setup_deferred = None self.sql_db = None if download_directory: self.download_directory = download_directory @@ -127,11 +128,13 @@ class EncryptedFileManager(object): payment_rate_manager = NegotiatedPaymentRateManager(b_prm, self.session.blob_tracker) yield self._check_stream_info_manager() lbry_files_and_options = yield self._get_all_lbry_files() + dl = [] for rowid, stream_hash, options in lbry_files_and_options: lbry_file = yield self.start_lbry_file(rowid, stream_hash, payment_rate_manager, blob_data_rate=options) - d = self._restore_lbry_file(lbry_file) + dl.append(self._restore_lbry_file(lbry_file)) log.debug("Started %s", lbry_file) + self.lbry_files_setup_deferred = defer.DeferredList(dl) log.info("Started %i lbry files", len(self.lbry_files)) defer.returnValue(True) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index eb94e2e0d..97b0c85cd 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -790,7 +790,9 @@ class Daemon(AuthJSONRPCServer): claim_out = yield publisher.update_stream(name, bid, metadata) else: claim_out = yield publisher.publish_stream(name, file_path, bid, metadata) - yield threads.deferToThread(reupload.reflect_stream, publisher.lbry_file) + d = reupload.reflect_stream(publisher.lbry_file) + d.addCallbacks(lambda _: log.info("Reflected new publication to lbry://%s", name), + log.exception) log.info("Success! Published to lbry://%s txid: %s nout: %d", name, claim_out['txid'], claim_out['nout'])