Add setting to disable reuploading to reflector

This commit is contained in:
Job Evers-Meltzer 2016-12-14 10:33:14 -06:00
parent fec917b9c1
commit fa29c92760
2 changed files with 8 additions and 3 deletions

View file

@ -182,6 +182,7 @@ ENVIRONMENT = Env(
# all of your credits.
API_INTERFACE=(str, "localhost"),
bittrex_feed=(str, "https://bittrex.com/api/v1.1/public/getmarkethistory"),
reflector_reupload=(bool, True),
)

View file

@ -74,10 +74,8 @@ class ManagedEncryptedFileDownloader(EncryptedFileSaver):
d.addCallbacks(_save_claim_id, lambda err: _notify_bad_claim(name, txid, nout))
return d
reflector_server = random.choice(settings.reflector_servers)
d.addCallback(_save_stream_info)
d.addCallback(lambda _: reupload.check_and_restore_availability(self, reflector_server))
d.addCallback(lambda _: self._reupload())
d.addCallback(lambda _: self.lbry_file_manager.get_lbry_file_status(self))
def restore_status(status):
@ -92,6 +90,12 @@ class ManagedEncryptedFileDownloader(EncryptedFileSaver):
d.addCallback(restore_status)
return d
def _reupload(self):
if not settings.reflector_reupload:
return
reflector_server = random.choice(settings.reflector_servers)
return reupload.check_and_restore_availability(self, reflector_server)
def stop(self, err=None, change_status=True):
def set_saving_status_done():