This commit is contained in:
Jack Robison 2018-02-12 15:19:34 -05:00
parent 9e11c075c6
commit 68c906aff9
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
3 changed files with 5 additions and 6 deletions

View file

@ -11,7 +11,7 @@ from lbrynet.core.server.DHTHashAnnouncer import DHTHashAnnouncer
from lbrynet.core.utils import generate_id from lbrynet.core.utils import generate_id
from lbrynet.core.PaymentRateManager import BasePaymentRateManager, NegotiatedPaymentRateManager from lbrynet.core.PaymentRateManager import BasePaymentRateManager, NegotiatedPaymentRateManager
from lbrynet.core.BlobAvailability import BlobAvailabilityTracker from lbrynet.core.BlobAvailability import BlobAvailabilityTracker
from twisted.internet import threads, defer, reactor from twisted.internet import threads, defer
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -152,7 +152,7 @@ def do_migration(db_dir):
# first migrate the blobs # first migrate the blobs
blobs = blobs_db_cursor.execute("select * from blobs").fetchall() blobs = blobs_db_cursor.execute("select * from blobs").fetchall()
_populate_blobs(blobs) _populate_blobs(blobs) # pylint: disable=no-value-for-parameter
log.info("migrated %i blobs", new_db.execute("select count(*) from blob").fetchone()[0]) log.info("migrated %i blobs", new_db.execute("select count(*) from blob").fetchone()[0])
# used to store the query arguments if we need to try re-importing the lbry file later # used to store the query arguments if we need to try re-importing the lbry file later
@ -220,7 +220,8 @@ def do_migration(db_dir):
for damaged_sd in damaged_sds_on_disk: for damaged_sd in damaged_sds_on_disk:
try: try:
decoded, sd_length = verify_sd_blob(damaged_sd, blob_dir) decoded, sd_length = verify_sd_blob(damaged_sd, blob_dir)
_add_recovered_blobs(decoded['blobs'], damaged_sd, sd_length) blobs = decoded['blobs']
_add_recovered_blobs(blobs, damaged_sd, sd_length) # pylint: disable=no-value-for-parameter
_import_file(*file_args[damaged_sd]) _import_file(*file_args[damaged_sd])
damaged_stream_sds.remove(damaged_sd) damaged_stream_sds.remove(damaged_sd)
except (OSError, ValueError, TypeError, IOError, AssertionError, sqlite3.IntegrityError): except (OSError, ValueError, TypeError, IOError, AssertionError, sqlite3.IntegrityError):
@ -245,7 +246,7 @@ def do_migration(db_dir):
log.info("migrated %i content claims", new_db.execute("select count(*) from content_claim").fetchone()[0]) log.info("migrated %i content claims", new_db.execute("select count(*) from content_claim").fetchone()[0])
_make_db() _make_db() # pylint: disable=no-value-for-parameter
connection.close() connection.close()
blobs_db.close() blobs_db.close()
lbryfile_db.close() lbryfile_db.close()

View file

@ -14,12 +14,10 @@ from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager
from lbrynet.core.Session import Session from lbrynet.core.Session import Session
from lbrynet.core.server.BlobAvailabilityHandler import BlobAvailabilityHandlerFactory from lbrynet.core.server.BlobAvailabilityHandler import BlobAvailabilityHandlerFactory
from lbrynet.core.client.StandaloneBlobDownloader import StandaloneBlobDownloader from lbrynet.core.client.StandaloneBlobDownloader import StandaloneBlobDownloader
from lbrynet.core.StreamDescriptor import BlobStreamDescriptorWriter
from lbrynet.core.StreamDescriptor import StreamDescriptorIdentifier from lbrynet.core.StreamDescriptor import StreamDescriptorIdentifier
from lbrynet.core.StreamDescriptor import download_sd_blob from lbrynet.core.StreamDescriptor import download_sd_blob
from lbrynet.file_manager.EncryptedFileCreator import create_lbry_file from lbrynet.file_manager.EncryptedFileCreator import create_lbry_file
from lbrynet.lbry_file.client.EncryptedFileOptions import add_lbry_file_to_sd_identifier from lbrynet.lbry_file.client.EncryptedFileOptions import add_lbry_file_to_sd_identifier
from lbrynet.core.StreamDescriptor import get_sd_info
from twisted.internet import defer, threads, task from twisted.internet import defer, threads, task
from twisted.trial.unittest import TestCase from twisted.trial.unittest import TestCase
from twisted.python.failure import Failure from twisted.python.failure import Failure