Remove the artificial slowdown

This commit is contained in:
Dave Pearson
2023-05-11 11:13:19 +01:00
parent 05eeaa7679
commit 9b41b743fe

View File

@@ -251,19 +251,11 @@ class DirectoryTree(Tree[DirEntry]):
Returns:
An iterator of `Path` objects.
"""
# TODO: Not like this. Oh so very not like this. This is here to
# slow things down on purpose, to emulate loading directory
# information from a slow source.
#
# REMOVE BEFORE FLIGHT!
import time
worker = get_current_worker()
for entry in directory.iterdir():
if worker.is_cancelled:
return
yield entry
time.sleep(0.05)
def _populate_node(
self, node: TreeNode[DirEntry], directory: Iterable[Path]