fireback finished_deferred after deleting from self.writers so that BlobFile state is accurate after finished_deferred is called
This commit is contained in:
parent
b655cd4fa6
commit
f2deee7201
1 changed files with 2 additions and 3 deletions
|
@ -15,7 +15,6 @@ from lbrynet.core.utils import is_valid_blobhash
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class HashBlobReader(object):
|
class HashBlobReader(object):
|
||||||
implements(interfaces.IConsumer)
|
implements(interfaces.IConsumer)
|
||||||
|
|
||||||
|
@ -142,8 +141,8 @@ class HashBlob(object):
|
||||||
self._verified = True
|
self._verified = True
|
||||||
for p, (w, finished_deferred) in self.writers.items():
|
for p, (w, finished_deferred) in self.writers.items():
|
||||||
if w == writer:
|
if w == writer:
|
||||||
finished_deferred.callback(self)
|
|
||||||
del self.writers[p]
|
del self.writers[p]
|
||||||
|
finished_deferred.callback(self)
|
||||||
return True
|
return True
|
||||||
log.warning(
|
log.warning(
|
||||||
"Somehow, the writer that was accepted as being valid was already removed: %s",
|
"Somehow, the writer that was accepted as being valid was already removed: %s",
|
||||||
|
@ -153,8 +152,8 @@ class HashBlob(object):
|
||||||
def errback_finished_deferred(err):
|
def errback_finished_deferred(err):
|
||||||
for p, (w, finished_deferred) in self.writers.items():
|
for p, (w, finished_deferred) in self.writers.items():
|
||||||
if w == writer:
|
if w == writer:
|
||||||
finished_deferred.errback(err)
|
|
||||||
del self.writers[p]
|
del self.writers[p]
|
||||||
|
finished_deferred.errback(err)
|
||||||
|
|
||||||
def cancel_other_downloads():
|
def cancel_other_downloads():
|
||||||
for p, (w, finished_deferred) in self.writers.items():
|
for p, (w, finished_deferred) in self.writers.items():
|
||||||
|
|
Loading…
Reference in a new issue