forked from LBRYCommunity/lbry-sdk
fixes
This commit is contained in:
parent
9e2cda0cdc
commit
f7c105fd80
3 changed files with 12 additions and 8 deletions
|
@ -270,7 +270,6 @@ class EncryptedFileManager(object):
|
||||||
def _save_lbry_file(self, stream_hash, data_payment_rate):
|
def _save_lbry_file(self, stream_hash, data_payment_rate):
|
||||||
def do_save(db_transaction):
|
def do_save(db_transaction):
|
||||||
row = (data_payment_rate, ManagedEncryptedFileDownloader.STATUS_STOPPED, stream_hash)
|
row = (data_payment_rate, ManagedEncryptedFileDownloader.STATUS_STOPPED, stream_hash)
|
||||||
log.debug('Saving %s to db', row)
|
|
||||||
db_transaction.execute("insert into lbry_file_options values (?, ?, ?)", row)
|
db_transaction.execute("insert into lbry_file_options values (?, ?, ?)", row)
|
||||||
return db_transaction.lastrowid
|
return db_transaction.lastrowid
|
||||||
return self.sql_db.runInteraction(do_save)
|
return self.sql_db.runInteraction(do_save)
|
||||||
|
|
|
@ -160,7 +160,7 @@ class FullLiveStreamDownloaderFactory(object):
|
||||||
def create_downloader(stream_hash):
|
def create_downloader(stream_hash):
|
||||||
stream_downloader = FullLiveStreamDownloader(stream_hash, self.peer_finder, self.rate_limiter,
|
stream_downloader = FullLiveStreamDownloader(stream_hash, self.peer_finder, self.rate_limiter,
|
||||||
self.blob_manager, self.stream_info_manager,
|
self.blob_manager, self.stream_info_manager,
|
||||||
prm, self.wallet, True)
|
prm, self.wallet)
|
||||||
d = stream_downloader.set_stream_info()
|
d = stream_downloader.set_stream_info()
|
||||||
d.addCallback(lambda _: stream_downloader)
|
d.addCallback(lambda _: stream_downloader)
|
||||||
return d
|
return d
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
from lbrynet.core import log_support
|
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
from multiprocessing import Process, Event, Queue
|
from multiprocessing import Process, Event, Queue
|
||||||
|
@ -61,7 +59,6 @@ GenFile = mocks.GenFile
|
||||||
test_create_stream_sd_file = mocks.create_stream_sd_file
|
test_create_stream_sd_file = mocks.create_stream_sd_file
|
||||||
DummyBlobAvailabilityTracker = mocks.BlobAvailabilityTracker
|
DummyBlobAvailabilityTracker = mocks.BlobAvailabilityTracker
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
log_format = "%(funcName)s(): %(message)s"
|
log_format = "%(funcName)s(): %(message)s"
|
||||||
logging.basicConfig(level=logging.WARNING, format=log_format)
|
logging.basicConfig(level=logging.WARNING, format=log_format)
|
||||||
|
@ -142,7 +139,11 @@ class LbryUploader(object):
|
||||||
d.addCallback(lambda _: self.create_stream())
|
d.addCallback(lambda _: self.create_stream())
|
||||||
d.addCallback(self.create_stream_descriptor)
|
d.addCallback(self.create_stream_descriptor)
|
||||||
d.addCallback(self.put_sd_hash_on_queue)
|
d.addCallback(self.put_sd_hash_on_queue)
|
||||||
d.addErrback(log.fail(), 'Failed to start')
|
|
||||||
|
def print_error(err):
|
||||||
|
logging.critical("Server error: %s", err.getErrorMessage())
|
||||||
|
|
||||||
|
d.addErrback(print_error)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def start_server(self):
|
def start_server(self):
|
||||||
|
@ -472,7 +473,11 @@ def start_blob_uploader(blob_hash_queue, kill_event, dead_event, slow, is_genero
|
||||||
d.addCallback(lambda _: start_server())
|
d.addCallback(lambda _: start_server())
|
||||||
d.addCallback(lambda _: create_single_blob())
|
d.addCallback(lambda _: create_single_blob())
|
||||||
d.addCallback(put_blob_hash_on_queue)
|
d.addCallback(put_blob_hash_on_queue)
|
||||||
d.addErrback(log.fail(), 'Failed to start')
|
|
||||||
|
def print_error(err):
|
||||||
|
logging.critical("Server error: %s", err.getErrorMessage())
|
||||||
|
|
||||||
|
d.addErrback(print_error)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def start_server():
|
def start_server():
|
||||||
|
@ -737,7 +742,7 @@ class TestTransfer(TestCase):
|
||||||
factories = metadata.factories
|
factories = metadata.factories
|
||||||
chosen_options = [
|
chosen_options = [
|
||||||
o.default_value for o in options.get_downloader_options(info_validator, prm)]
|
o.default_value for o in options.get_downloader_options(info_validator, prm)]
|
||||||
return factories[0].make_downloader(metadata, choosen_options, prm)
|
return factories[0].make_downloader(metadata, chosen_options, prm)
|
||||||
|
|
||||||
def start_lbry_file(lbry_file):
|
def start_lbry_file(lbry_file):
|
||||||
lbry_file = lbry_file
|
lbry_file = lbry_file
|
||||||
|
|
Loading…
Reference in a new issue