Add setting to disable reuploading to reflector
This commit is contained in:
parent
fec917b9c1
commit
fa29c92760
2 changed files with 8 additions and 3 deletions
|
@ -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),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -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():
|
||||
|
|
Loading…
Reference in a new issue