mirror of
https://github.com/logos-storage/bittorrent-benchmarks.git
synced 2026-01-05 06:23:13 +00:00
fix: check that cid is not none before removing
This commit is contained in:
parent
ee67a92726
commit
34a179b110
@ -110,14 +110,17 @@ class StaticDisseminationExperiment(
|
||||
def teardown(self, exception: Optional[Exception] = None):
|
||||
def _remove(element: Tuple[int, Node[TNetworkHandle, TInitialMetadata]]):
|
||||
index, node = element
|
||||
assert self._cid is not None # to please mypy
|
||||
# This means this node didn't even get to seed anything.
|
||||
if self._cid is None:
|
||||
return element
|
||||
|
||||
# Since teardown might be called as the result of an exception, it's expected
|
||||
# that not all removes will succeed, so we don't check their result.
|
||||
node.remove(self._cid)
|
||||
logger.info("Node %d (%s) removed file", index + 1, node.name)
|
||||
return element
|
||||
|
||||
try:
|
||||
# Since teardown might be called as the result of an exception, it's expected
|
||||
# that not all removes will succeed, so we don't check their result.
|
||||
ensure_successful(
|
||||
[
|
||||
self._executor.submit(_remove, (i, node))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user